Do not create one-time receipt during auth check.

This commit is contained in:
Alex Hart
2025-03-19 11:43:19 -03:00
committed by Cody Henthorne
parent 6f52851222
commit 1e866a1e86
2 changed files with 2 additions and 19 deletions

View File

@@ -144,18 +144,6 @@ class InAppPaymentAuthCheckJob private constructor(parameters: Parameters) : Bas
return checkIntentStatusResult
}
Log.i(TAG, "Creating and inserting receipt.", true)
val receipt = when (inAppPayment.type) {
InAppPaymentType.ONE_TIME_DONATION -> InAppPaymentReceiptRecord.createForBoost(inAppPayment.data.amount!!.toFiatMoney())
InAppPaymentType.ONE_TIME_GIFT -> InAppPaymentReceiptRecord.createForGift(inAppPayment.data.amount!!.toFiatMoney())
else -> {
Log.e(TAG, "Unexpected type ${inAppPayment.type}", true)
return CheckResult.Failure()
}
}
SignalDatabase.donationReceipts.addReceipt(receipt)
Log.i(TAG, "Verified payment. Updating InAppPayment::${inAppPayment.id.serialize()}")
SignalDatabase.inAppPayments.update(
inAppPayment = inAppPayment.copy(

View File

@@ -159,17 +159,12 @@ class InAppPaymentOneTimeContextJob private constructor(
SignalDatabase.inAppPayments.update(
inAppPayment.copy(
data = inAppPayment.data.copy(
waitForAuth = null,
stripeActionComplete = null,
payPalActionComplete = null,
payPalRequiresAction = null,
stripeRequiresAction = null,
data = inAppPayment.data.newBuilder().redemption(
redemption = InAppPaymentData.RedemptionState(
stage = InAppPaymentData.RedemptionState.Stage.REDEMPTION_STARTED,
receiptCredentialPresentation = receiptCredentialPresentation.serialize().toByteString()
)
)
).build()
)
)
} else {