mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-25 21:48:17 +00:00
Do not create one-time receipt during auth check.
This commit is contained in:
committed by
Cody Henthorne
parent
6f52851222
commit
1e866a1e86
@@ -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(
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user