Rename DonationErrorSource value to MONTHLY.
This commit is contained in:
parent
940e67b1ca
commit
f9336f2a28
10 changed files with 21 additions and 21 deletions
|
@ -198,9 +198,9 @@ class MonthlyDonationRepository(private val donationsService: DonationsService)
|
|||
}
|
||||
|
||||
val timeoutError: DonationError = if (isLongRunning) {
|
||||
DonationError.donationPending(DonationErrorSource.SUBSCRIPTION, gatewayRequest)
|
||||
DonationError.donationPending(DonationErrorSource.MONTHLY, gatewayRequest)
|
||||
} else {
|
||||
DonationError.timeoutWaitingForToken(DonationErrorSource.SUBSCRIPTION)
|
||||
DonationError.timeoutWaitingForToken(DonationErrorSource.MONTHLY)
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -212,7 +212,7 @@ class MonthlyDonationRepository(private val donationsService: DonationsService)
|
|||
}
|
||||
JobTracker.JobState.FAILURE -> {
|
||||
Log.d(TAG, "Subscription request response job chain failed permanently.", true)
|
||||
it.onError(DonationError.genericBadgeRedemptionFailure(DonationErrorSource.SUBSCRIPTION))
|
||||
it.onError(DonationError.genericBadgeRedemptionFailure(DonationErrorSource.MONTHLY))
|
||||
}
|
||||
else -> {
|
||||
Log.d(TAG, "Subscription request response job chain ignored due to in-progress jobs.", true)
|
||||
|
|
|
@ -106,7 +106,7 @@ class DonateToSignalFragment :
|
|||
}
|
||||
|
||||
override fun bindAdapter(adapter: MappingAdapter) {
|
||||
donationCheckoutDelegate = DonationCheckoutDelegate(this, this, viewModel.uiSessionKey, DonationErrorSource.ONE_TIME, DonationErrorSource.SUBSCRIPTION)
|
||||
donationCheckoutDelegate = DonationCheckoutDelegate(this, this, viewModel.uiSessionKey, DonationErrorSource.ONE_TIME, DonationErrorSource.MONTHLY)
|
||||
|
||||
val recyclerView = this.recyclerView!!
|
||||
recyclerView.overScrollMode = RecyclerView.OVER_SCROLL_IF_CONTENT_SCROLLS
|
||||
|
|
|
@ -13,7 +13,7 @@ enum class DonateToSignalType(val requestCode: Short) : Parcelable {
|
|||
fun toErrorSource(): DonationErrorSource {
|
||||
return when (this) {
|
||||
ONE_TIME -> DonationErrorSource.ONE_TIME
|
||||
MONTHLY -> DonationErrorSource.SUBSCRIPTION
|
||||
MONTHLY -> DonationErrorSource.MONTHLY
|
||||
GIFT -> DonationErrorSource.GIFT
|
||||
}
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ class DonationCheckoutDelegate(
|
|||
|
||||
val error = DonationError.getGooglePayRequestTokenError(
|
||||
source = when (request.donateToSignalType) {
|
||||
DonateToSignalType.MONTHLY -> DonationErrorSource.SUBSCRIPTION
|
||||
DonateToSignalType.MONTHLY -> DonationErrorSource.MONTHLY
|
||||
DonateToSignalType.ONE_TIME -> DonationErrorSource.ONE_TIME
|
||||
DonateToSignalType.GIFT -> DonationErrorSource.GIFT
|
||||
},
|
||||
|
|
|
@ -51,7 +51,7 @@ class CreditCardFragment : Fragment(R.layout.credit_card_fragment) {
|
|||
|
||||
val errorSource: DonationErrorSource = when (args.request.donateToSignalType) {
|
||||
DonateToSignalType.ONE_TIME -> DonationErrorSource.ONE_TIME
|
||||
DonateToSignalType.MONTHLY -> DonationErrorSource.SUBSCRIPTION
|
||||
DonateToSignalType.MONTHLY -> DonationErrorSource.MONTHLY
|
||||
DonateToSignalType.GIFT -> DonationErrorSource.GIFT
|
||||
}
|
||||
|
||||
|
|
|
@ -93,8 +93,8 @@ class PayPalPaymentInProgressViewModel(
|
|||
Log.w(TAG, "Failed to update subscription", throwable, true)
|
||||
val donationError: DonationError = when (throwable) {
|
||||
is DonationError -> throwable
|
||||
is DonationProcessorError -> throwable.toDonationError(DonationErrorSource.SUBSCRIPTION, PaymentSourceType.PayPal)
|
||||
else -> DonationError.genericBadgeRedemptionFailure(DonationErrorSource.SUBSCRIPTION)
|
||||
is DonationProcessorError -> throwable.toDonationError(DonationErrorSource.MONTHLY, PaymentSourceType.PayPal)
|
||||
else -> DonationError.genericBadgeRedemptionFailure(DonationErrorSource.MONTHLY)
|
||||
}
|
||||
DonationError.routeDonationError(ApplicationDependencies.getApplication(), donationError)
|
||||
|
||||
|
@ -187,7 +187,7 @@ class PayPalPaymentInProgressViewModel(
|
|||
.andThen(payPalRepository.createPaymentMethod())
|
||||
.flatMap(routeToPaypalConfirmation)
|
||||
.flatMapCompletable { payPalRepository.setDefaultPaymentMethod(it.paymentId) }
|
||||
.onErrorResumeNext { Completable.error(DonationError.getPaymentSetupError(DonationErrorSource.SUBSCRIPTION, it, PaymentSourceType.PayPal)) }
|
||||
.onErrorResumeNext { Completable.error(DonationError.getPaymentSetupError(DonationErrorSource.MONTHLY, it, PaymentSourceType.PayPal)) }
|
||||
|
||||
disposables += setup.andThen(monthlyDonationRepository.setSubscriptionLevel(request, false))
|
||||
.subscribeBy(
|
||||
|
@ -197,8 +197,8 @@ class PayPalPaymentInProgressViewModel(
|
|||
|
||||
val donationError: DonationError = when (throwable) {
|
||||
is DonationError -> throwable
|
||||
is DonationProcessorError -> throwable.toDonationError(DonationErrorSource.SUBSCRIPTION, PaymentSourceType.PayPal)
|
||||
else -> DonationError.genericBadgeRedemptionFailure(DonationErrorSource.SUBSCRIPTION)
|
||||
is DonationProcessorError -> throwable.toDonationError(DonationErrorSource.MONTHLY, PaymentSourceType.PayPal)
|
||||
else -> DonationError.genericBadgeRedemptionFailure(DonationErrorSource.MONTHLY)
|
||||
}
|
||||
DonationError.routeDonationError(ApplicationDependencies.getApplication(), donationError)
|
||||
},
|
||||
|
|
|
@ -74,7 +74,7 @@ class StripePaymentInProgressViewModel(
|
|||
|
||||
val errorSource = when (request.donateToSignalType) {
|
||||
DonateToSignalType.ONE_TIME -> DonationErrorSource.ONE_TIME
|
||||
DonateToSignalType.MONTHLY -> DonationErrorSource.SUBSCRIPTION
|
||||
DonateToSignalType.MONTHLY -> DonationErrorSource.MONTHLY
|
||||
DonateToSignalType.GIFT -> DonationErrorSource.GIFT
|
||||
}
|
||||
|
||||
|
@ -152,8 +152,8 @@ class StripePaymentInProgressViewModel(
|
|||
.onErrorResumeNext {
|
||||
when {
|
||||
it is DonationError -> Completable.error(it)
|
||||
it is DonationProcessorError -> Completable.error(it.toDonationError(DonationErrorSource.SUBSCRIPTION, paymentSourceProvider.paymentSourceType))
|
||||
else -> Completable.error(DonationError.getPaymentSetupError(DonationErrorSource.SUBSCRIPTION, it, paymentSourceProvider.paymentSourceType))
|
||||
it is DonationProcessorError -> Completable.error(it.toDonationError(DonationErrorSource.MONTHLY, paymentSourceProvider.paymentSourceType))
|
||||
else -> Completable.error(DonationError.getPaymentSetupError(DonationErrorSource.MONTHLY, it, paymentSourceProvider.paymentSourceType))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ class StripePaymentInProgressViewModel(
|
|||
val donationError: DonationError = if (throwable is DonationError) {
|
||||
throwable
|
||||
} else {
|
||||
DonationError.genericBadgeRedemptionFailure(DonationErrorSource.SUBSCRIPTION)
|
||||
DonationError.genericBadgeRedemptionFailure(DonationErrorSource.MONTHLY)
|
||||
}
|
||||
DonationError.routeDonationError(ApplicationDependencies.getApplication(), donationError)
|
||||
},
|
||||
|
@ -256,8 +256,8 @@ class StripePaymentInProgressViewModel(
|
|||
Log.w(TAG, "Failed to update subscription", throwable, true)
|
||||
val donationError: DonationError = when (throwable) {
|
||||
is DonationError -> throwable
|
||||
is DonationProcessorError -> throwable.toDonationError(DonationErrorSource.SUBSCRIPTION, PaymentSourceType.Stripe.GooglePay)
|
||||
else -> DonationError.genericBadgeRedemptionFailure(DonationErrorSource.SUBSCRIPTION)
|
||||
is DonationProcessorError -> throwable.toDonationError(DonationErrorSource.MONTHLY, PaymentSourceType.Stripe.GooglePay)
|
||||
else -> DonationError.genericBadgeRedemptionFailure(DonationErrorSource.MONTHLY)
|
||||
}
|
||||
DonationError.routeDonationError(ApplicationDependencies.getApplication(), donationError)
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ class BankTransferDetailsFragment : ComposeFragment(), DonationCheckoutDelegate.
|
|||
|
||||
val errorSource: DonationErrorSource = when (args.request.donateToSignalType) {
|
||||
DonateToSignalType.ONE_TIME -> DonationErrorSource.ONE_TIME
|
||||
DonateToSignalType.MONTHLY -> DonationErrorSource.SUBSCRIPTION
|
||||
DonateToSignalType.MONTHLY -> DonationErrorSource.MONTHLY
|
||||
DonateToSignalType.GIFT -> DonationErrorSource.GIFT
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ enum class DonationErrorSource(private val code: String) {
|
|||
* Refers to a recurring monthly donation where the user paying receives a badge immediately
|
||||
* and upon each renewal period.
|
||||
*/
|
||||
SUBSCRIPTION("subscription"),
|
||||
MONTHLY("subscription"),
|
||||
|
||||
/**
|
||||
* Refers to a one-time donation where the user pays to send a badge to another individual.
|
||||
|
|
|
@ -396,7 +396,7 @@ public class SubscriptionReceiptRequestResponseJob extends BaseJob {
|
|||
}
|
||||
|
||||
private DonationErrorSource getErrorSource() {
|
||||
return isForKeepAlive ? DonationErrorSource.KEEP_ALIVE : DonationErrorSource.SUBSCRIPTION;
|
||||
return isForKeepAlive ? DonationErrorSource.KEEP_ALIVE : DonationErrorSource.MONTHLY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue