mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-02 00:17:41 +01:00
Treat 409 as successful redemption for recurring donation.
Co-authored-by: Greyson Parrelli <greyson@signal.org>
This commit is contained in:
@@ -547,7 +547,20 @@ class InAppPaymentRecurringContextJob private constructor(
|
||||
}
|
||||
|
||||
409 -> {
|
||||
warning("Already redeemed this token during new subscription. Failing.", applicationError)
|
||||
warning("Already redeemed this token during new subscription.", applicationError)
|
||||
|
||||
if (inAppPayment.type == InAppPaymentType.RECURRING_DONATION) {
|
||||
info("Token already redeemed for recurring donation. Treating as successful redemption.")
|
||||
SignalDatabase.inAppPayments.update(
|
||||
inAppPayment = inAppPayment.copy(
|
||||
state = InAppPaymentTable.State.END,
|
||||
data = inAppPayment.data.newBuilder().redemption(
|
||||
redemption = InAppPaymentData.RedemptionState(stage = InAppPaymentData.RedemptionState.Stage.REDEEMED)
|
||||
).build()
|
||||
)
|
||||
)
|
||||
throw Exception(applicationError)
|
||||
}
|
||||
|
||||
// During keep-alive processing, we don't alert the user about redemption failures.
|
||||
if (inAppPayment.type == InAppPaymentType.RECURRING_BACKUP && inAppPayment.data.redemption?.keepAlive != true) {
|
||||
|
||||
Reference in New Issue
Block a user