Skip to content

Commit

Permalink
Finish all transactions with identifier... just incase....
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno committed Sep 19, 2022
1 parent d6d726a commit 592f642
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Plugin.InAppBilling/InAppBilling.apple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,14 @@ public async override Task<bool> FinalizePurchaseAsync(string transactionIdentif
if (purchases == null)
return false;

var transaction = purchases.Where(p => p.TransactionIdentifier == transactionIdentifier).FirstOrDefault();
if (transaction == null)
return false;
var transactions = purchases.Where(p => p.TransactionIdentifier == transactionIdentifier);

if ((transactions?.Count() ?? 0) == 0)
return false;
try
{
SKPaymentQueue.DefaultQueue.FinishTransaction(transaction);
foreach(var transaction in transactions)
SKPaymentQueue.DefaultQueue.FinishTransaction(transaction);
}
catch(Exception ex)
{
Expand Down

0 comments on commit 592f642

Please sign in to comment.