<!--
{
  "documentType" : "article",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/testing-transaction-observer-code",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Testing transaction observer code"
}
-->

# Testing transaction observer code

Verify that your app activates its payment transaction observer by using breakpoints.

## Discussion

Review the transaction observer’s implementation of the [`SKPaymentTransactionObserver`](/documentation/StoreKit/SKPaymentTransactionObserver) protocol. Verify that the [`SKPaymentTransactionObserver`](/documentation/StoreKit/SKPaymentTransactionObserver) listens for transactions when:

- Your app isn’t displaying its store UI
- If you didn’t recently initiate a purchase

Locate the call to the [`add(_:)`](/documentation/StoreKit/SKPaymentQueue/add(_:)-5ciz2) method of [`SKPaymentQueue`](/documentation/StoreKit/SKPaymentQueue) in your code. Verify that your app calls this method at app launch. For more information, see [Setting up the transaction observer for the payment queue](/documentation/StoreKit/setting-up-the-transaction-observer-for-the-payment-queue).

---

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)