paymentQueue method

void paymentQueue(
  1. SKPaymentQueueWrapper queue,
  2. SKPaymentTransactionWrapper transaction
)

Implementation

void paymentQueue(SKPaymentQueueWrapper queue, SKPaymentTransactionWrapper transaction) {
  // You can add more detailed handling here if necessary

  if (transaction.transactionState == SKPaymentTransactionStateWrapper.purchased) {
    // Complete the purchase on success
  } else if (transaction.transactionState == SKPaymentTransactionStateWrapper.failed) {
    AppLogs.showErrorLogs("Transaction failed: ${transaction.transactionState} - ${transaction.error}");
    SKPaymentQueueWrapper().finishTransaction(transaction);
  }
}