Heal SEPA transfer keep-alive failures.

This commit is contained in:
Alex Hart
2024-09-19 12:23:51 -03:00
committed by GitHub
parent 71f6c77b42
commit 1d719333a3

View File

@@ -10,6 +10,7 @@ import org.signal.core.util.logging.Log
import org.thoughtcrime.securesms.badges.Badges
import org.thoughtcrime.securesms.components.settings.app.subscription.DonationSerializationHelper.toDecimalValue
import org.thoughtcrime.securesms.components.settings.app.subscription.InAppPaymentsRepository
import org.thoughtcrime.securesms.components.settings.app.subscription.InAppPaymentsRepository.toPaymentSourceType
import org.thoughtcrime.securesms.components.settings.app.subscription.manage.DonationRedemptionJobStatus
import org.thoughtcrime.securesms.components.settings.app.subscription.manage.DonationRedemptionJobWatcher
import org.thoughtcrime.securesms.database.InAppPaymentTable
@@ -281,6 +282,19 @@ class InAppPaymentKeepAliveJob private constructor(
)
)
SignalDatabase.inAppPayments.getById(current.id)
} else if (current.state == InAppPaymentTable.State.END && current.data.error != null && current.data.paymentMethodType == InAppPaymentData.PaymentMethodType.UNKNOWN && subscriber.paymentMethodType.toPaymentSourceType().isBankTransfer) {
info(type, "Found failed SEPA payment but there's no payment method assigned. Assigning payment method and retrying.")
SignalDatabase.inAppPayments.update(
current.copy(
state = InAppPaymentTable.State.PENDING,
data = current.data.copy(
paymentMethodType = subscriber.paymentMethodType,
error = null
)
)
)
SignalDatabase.inAppPayments.getById(current.id)
} else {
current