5

Is it any way to test refunding of the purchase as a Test User?

I am implementing server-side logic for non-renewing subscriptions, I figured out that, if refund was made, apple validation server will respond with additional field cancellation_date.

So, is it any chance to generate send-box receipt, that will return JSON with cancellation_date field?

  • Possible duplicate of [iOS In App Purchase: test a real purchase without submitting to Apple](http://stackoverflow.com/questions/13498005/ios-in-app-purchase-test-a-real-purchase-without-submitting-to-apple) – Pavel Pája Halbich Jul 04 '16 at 09:27
  • @PavelPájaHalbich my question is about testing refunds, not testing app in production at general. – Oleh Hutsalo Jul 04 '16 at 10:20
  • Sorry, my bad. Well, I've searched a litle and found this: http://stackoverflow.com/questions/29256997/refund-of-ios-in-app-purchase-triggered-by-developer-not-end-user Will it help you in any way? – Pavel Pája Halbich Jul 04 '16 at 10:37

1 Answers1

0

It is possible to test refund request in the Sandbox environment if the iOS app is running on iOS 15+.

A new function named beginRefundRequest(in:) was added to StoreKit in iOS 15.0+. By calling this from within the app (e.g., from the Account Settings or Help menu), the system will display the following refund request sheet. On this sheet, you can select the Refund Request item and request a refund.

Even in the Sandbox environment, after refunding request from this sheet, the cancellation_date field is added in the responseBody.Latest_receipt_info and responseBody.Receipt.In_app arrays in the JSON response of verifyReceipt API.

enter image description here

Kazunori Takaishi
  • 2,268
  • 1
  • 15
  • 27