Help testing sandbox purchases in Xcode

I am attempting to test non-consumable sandbox purchases, however I am unable to select the "Approve Transaction" option after initiating a purchase. Leaving the transaction in a permanent pending state. I can view the transaction in the transaction manager by navigating to Debug -> Storekit -> Manage Transactions.. but the only available options to select are "Refund Transaction" or "Delete Transaction".

What am I missing about Xcode or my environment that is preventing me from testing this purchase flow?

Some more information about my set up.

  • I have a .storekit file synced to AppStore Connect with my product Id.
  • There's a StoreKitTestCertificate.cert saved in the project.
  • I've tried running the build on my phone as Debug, Release and ReleaseForRunning all with the same behavior after making a purchase.
  • My phone is logged into a sandbox test user apple account in the developer iOS settings
Answered by clueless-developer in 859252022

I figured out my issue here. The reason I could not approve or decline the transaction was because it was already "successful". I was missing a step in my IAP code where after making the purchase, I needed to let apple know the purchased rewards were granted and the purchase was "finished". I my case I was using the Unity IAP API so I needed to call ConfirmPurchase on the pending order to finalize the transaction. https://docs.unity.com/ugs/en-us/manual/iap/manual/purchases#purchase-acknowledgement-and-reliability

Accepted Answer

I figured out my issue here. The reason I could not approve or decline the transaction was because it was already "successful". I was missing a step in my IAP code where after making the purchase, I needed to let apple know the purchased rewards were granted and the purchase was "finished". I my case I was using the Unity IAP API so I needed to call ConfirmPurchase on the pending order to finalize the transaction. https://docs.unity.com/ugs/en-us/manual/iap/manual/purchases#purchase-acknowledgement-and-reliability

Help testing sandbox purchases in Xcode
 
 
Q