diff --git a/app/src/main/java/org/thoughtcrime/securesms/jobs/InAppPaymentAuthCheckJob.kt b/app/src/main/java/org/thoughtcrime/securesms/jobs/InAppPaymentAuthCheckJob.kt index 98a25b4a5c..69028b5556 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/jobs/InAppPaymentAuthCheckJob.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/InAppPaymentAuthCheckJob.kt @@ -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( diff --git a/app/src/main/java/org/thoughtcrime/securesms/jobs/InAppPaymentOneTimeContextJob.kt b/app/src/main/java/org/thoughtcrime/securesms/jobs/InAppPaymentOneTimeContextJob.kt index af20ea164f..d55264748d 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/jobs/InAppPaymentOneTimeContextJob.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/InAppPaymentOneTimeContextJob.kt @@ -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 {