<!--
{
  "documentType" : "article",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/testing-a-payment-request",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Testing a payment request"
}
-->

# Testing a payment request

Verify that requests for payment function properly in the sandbox environment by inspecting the calls to the payment transaction observer.

## Discussion

Create an instance of [`SKPayment`](/documentation/StoreKit/SKPayment) using a valid product identifier that you’ve already tested, as described in [Testing fetching product identifiers](/documentation/StoreKit/testing-fetching-product-identifiers). Set a breakpoint and inspect the payment request. Add the payment request to the transaction queue, and set a breakpoint to confirm that the system calls your observer’s [`paymentQueue(_:updatedTransactions:)`](/documentation/StoreKit/SKPaymentTransactionObserver/paymentQueue(_:updatedTransactions:)) method.

Though you can finish the transaction immediately without providing the content of the purchase during testing, failing to finish the transaction can cause problems. Unfinished transactions remain in the queue indefinitely, which could interfere with later testing. Complete the transaction as described in [Finishing a transaction](/documentation/StoreKit/finishing-a-transaction) at the end of each test.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)