Skip to content

Commit

Permalink
pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
LouiseHsu committed Nov 13, 2024
1 parent 1cf595c commit 0bf665b
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,10 @@ public class InAppPurchasePlugin: NSObject, FlutterPlugin, FIAInAppPurchaseAPI {
// If the user cancels the purchase dialog we won't have a transactionIdentifier.
// So if it is null AND a transaction in the pendingTransactions list has
// also a null transactionIdentifier we check for equal product identifiers.
guard
transaction.transactionIdentifier == transactionIdentifier
|| (transactionIdentifier == nil && transaction.transactionIdentifier == nil
&& transaction.payment.productIdentifier == productIdentifier)
else {
let matchesTransactionIdentifier = transaction.transactionIdentifier == transactionIdentifier;
let isRestoringTransaction = transactionIdentifier == nil && transaction.transactionIdentifier == nil && transaction.payment.productIdentifier == productIdentifier

guard matchesTransactionIdentifier || isRestoringTransaction else {
return
}
getPaymentQueueHandler().finish(transaction)
Expand Down

0 comments on commit 0bf665b

Please sign in to comment.