How to validate subscription level switching on the backend?

In iTunes Connect we set up one subscription group with all subscriptions (Premium Monthly, Premium Yearly, Plus Monthly, Plus Yearly). Currently we have 1 level with Premium Monthly and Premium yearly and second level with Plus Monthly and Plus Yearly. Second group is being downgrade of first group.

We are currently implementing subscription level switching on iOS, have been testing several scenarios on SANDBOX and have encountered several problems. As of now, in the application we’ve got two subscription levels, one is plus the other is premium. Each of those is divided into two additional plans, monthly and yearly. We would like now to allow our users to easily switch from plus to premium or vice versa and between monthly and yearly plan in a specific subscription level and vice versa, as well.


Our current verification works in a way that the device posts apple receipt to the server, the server calls Apple's verifyReceipt service to obtain data about the receipt and then processes this data. However, one thing I have noticed, when the user for example switches from plus to premium in the application, 2 records are returned in the latest_receipt_info array (as expected) but the original plus plan (which is now no longer active, considering the user switched to premium) does not contain any information that it is not active anymore.


I got used to verifying the cancellation_date property when a user cancels their current plan to switch to a different, however this property is not present in the response object during the subscription level switch, which got me thinking that the original one has not been cancelled.

The question really is, is the cancellation_date absent because it is a SANDBOX environment and it will be there in PRODUCTION, or is the cancellation_date property going to be absent in PRODUCTION as well and I will have to change the receipt verification logic?


How do you personally go about validating these purchases on the server?

Replies

Did you find an answer?