Remove IsGooglePayAvailable error and check.

This commit is contained in:
Alex Hart 2022-02-11 10:05:53 -04:00
parent 13a015fa13
commit 34f3ae38cc
4 changed files with 0 additions and 27 deletions

View file

@ -58,8 +58,6 @@ class DonationPaymentRepository(activity: Activity) : StripeApi.PaymentIntentFet
private val googlePayApi = GooglePayApi(activity, StripeApi.Gateway(Environment.Donations.STRIPE_CONFIGURATION), Environment.Donations.GOOGLE_PAY_CONFIGURATION) private val googlePayApi = GooglePayApi(activity, StripeApi.Gateway(Environment.Donations.STRIPE_CONFIGURATION), Environment.Donations.GOOGLE_PAY_CONFIGURATION)
private val stripeApi = StripeApi(Environment.Donations.STRIPE_CONFIGURATION, this, this, ApplicationDependencies.getOkHttpClient()) private val stripeApi = StripeApi(Environment.Donations.STRIPE_CONFIGURATION, this, this, ApplicationDependencies.getOkHttpClient())
fun isGooglePayAvailable(): Completable = googlePayApi.queryIsReadyToPay()
fun scheduleSyncForAccountRecordChange() { fun scheduleSyncForAccountRecordChange() {
SignalExecutors.BOUNDED.execute { SignalExecutors.BOUNDED.execute {
scheduleSyncForAccountRecordChangeSync() scheduleSyncForAccountRecordChangeSync()

View file

@ -110,16 +110,6 @@ class BoostViewModel(
} }
) )
disposables += donationPaymentRepository.isGooglePayAvailable().subscribeBy(
onComplete = { store.update { it.copy(isGooglePayAvailable = true) } },
onError = {
DonationError.routeDonationError(
ApplicationDependencies.getApplication(),
DonationError.getGooglePayNotAvailableError(DonationErrorSource.BOOST, it)
)
}
)
disposables += currencyObservable.subscribeBy { currency -> disposables += currencyObservable.subscribeBy { currency ->
store.update { store.update {
it.copy( it.copy(

View file

@ -107,11 +107,6 @@ sealed class DonationError(val source: DonationErrorSource, cause: Throwable) :
} }
} }
@JvmStatic
fun getGooglePayNotAvailableError(source: DonationErrorSource, throwable: Throwable): DonationError {
return GooglePayError.NotAvailableError(source, throwable)
}
@JvmStatic @JvmStatic
fun getGooglePayRequestTokenError(source: DonationErrorSource, throwable: Throwable): DonationError { fun getGooglePayRequestTokenError(source: DonationErrorSource, throwable: Throwable): DonationError {
return GooglePayError.RequestTokenError(source, throwable) return GooglePayError.RequestTokenError(source, throwable)

View file

@ -131,16 +131,6 @@ class SubscribeViewModel(
onError = this::handleSubscriptionDataLoadFailure onError = this::handleSubscriptionDataLoadFailure
) )
disposables += donationPaymentRepository.isGooglePayAvailable().subscribeBy(
onComplete = { store.update { it.copy(isGooglePayAvailable = true) } },
onError = {
DonationError.routeDonationError(
ApplicationDependencies.getApplication(),
DonationError.getGooglePayNotAvailableError(DonationErrorSource.BOOST, it)
)
}
)
disposables += currency.subscribe { selection -> disposables += currency.subscribe { selection ->
store.update { it.copy(currencySelection = selection) } store.update { it.copy(currencySelection = selection) }
} }