Implement refactor to utilize new donation configuration endpoint.

This commit is contained in:
Alex Hart
2022-12-06 12:07:24 -04:00
committed by Cody Henthorne
parent 40cf87307a
commit 424a0233c2
23 changed files with 847 additions and 229 deletions

View File

@@ -102,6 +102,12 @@ internal class DonationsValues internal constructor(store: KeyValueStore) : Sign
* in determining which error messaging they should see if something goes wrong.
*/
private const val SUBSCRIPTION_PAYMENT_SOURCE_TYPE = "subscription.payment.source.type"
/**
* Marked whenever we check for Google Pay availability, to help make decisions without
* awaiting the background task.
*/
private const val IS_GOOGLE_PAY_READY = "subscription.is.google.pay.ready"
}
override fun onFirstEverAppLaunch() = Unit
@@ -354,6 +360,8 @@ internal class DonationsValues internal constructor(store: KeyValueStore) : Sign
get() = getBoolean(SHOULD_CANCEL_SUBSCRIPTION_BEFORE_NEXT_SUBSCRIBE_ATTEMPT, false)
set(value) = putBoolean(SHOULD_CANCEL_SUBSCRIPTION_BEFORE_NEXT_SUBSCRIBE_ATTEMPT, value)
var isGooglePayReady: Boolean by booleanValue(IS_GOOGLE_PAY_READY, false)
/**
* Consolidates a bunch of data clears that should occur whenever a user manually cancels their
* subscription: