I'm developing an app that offers auto-renewing subscriptions.
I do not know how the JSON response from Apple will look like when validating the receipt hash if a user has purchased subscription.A
(which renews after 7 days), and then goes to his iTunes settings and changes it to renew into subscription.B
from the same subscription family.
For subscription.A
it will look like this after renewing a couple of times:
...
{"quantity":"1", "product_id":"subscription.A", "transaction_id":"100000015494389", "original_transaction_id":"100000015494368", "purchase_date":"2015-05-12 11:42:01 Etc/GMT", "purchase_date_ms":"1431430921000", "purchase_date_pst":"2015-05-12 04:42:01 America/Los_Angeles", "original_purchase_date":"2015-05-12 11:40:03 Etc/GMT", "original_purchase_date_ms":"1431430803000", "original_purchase_date_pst":"2015-05-12 04:40:03 America/Los_Angeles", "expires_date":"2015-05-12 11:47:01 Etc/GMT", "expires_date_ms":"1431431221000", "expires_date_pst":"2015-05-12 04:47:01 America/Los_Angeles", "web_order_line_item_id":"100000002973145", "is_trial_period":"false"},
{"quantity":"1", "product_id":"subscription.A", "transaction_id":"100000015494368", "original_transaction_id":"100000015494368", "purchase_date":"2015-05-12 11:37:01 Etc/GMT", "purchase_date_ms":"1431430621000", "purchase_date_pst":"2015-05-12 04:37:01 America/Los_Angeles", "original_purchase_date":"2015-05-12 11:37:02 Etc/GMT", "original_purchase_date_ms":"1431430622000", "original_purchase_date_pst":"2015-05-12 04:37:02 America/Los_Angeles", "expires_date":"2015-05-12 11:42:01 Etc/GMT", "expires_date_ms":"1431430921000", "expires_date_pst":"2015-05-12 04:42:01 America/Los_Angeles", "web_order_line_item_id":"100000002973145", "is_trial_period":"false"},
{"quantity":"1", "product_id":"subscription.A", "transaction_id":"100000015494496", "original_transaction_id":"100000015494368", "purchase_date":"2015-05-12 11:47:01 Etc/GMT", "purchase_date_ms":"1431431221000", "purchase_date_pst":"2015-05-12 04:47:01 America/Los_Angeles", "original_purchase_date":"2015-05-12 11:45:32 Etc/GMT", "original_purchase_date_ms":"1431431132000", "original_purchase_date_pst":"2015-05-12 04:45:32 America/Los_Angeles", "expires_date":"2015-05-12 11:52:01 Etc/GMT", "expires_date_ms":"1431431521000", "expires_date_pst":"2015-05-12 04:52:01 America/Los_Angeles", "web_order_line_item_id":"100000002973147", "is_trial_period":"false"},
{"quantity":"1", "product_id":"subscription.A", "transaction_id":"100000015494517", "original_transaction_id":"100000015494368", "purchase_date":"2015-05-12 11:52:01 Etc/GMT", "purchase_date_ms":"1431431521000", "purchase_date_pst":"2015-05-12 04:52:01 America/Los_Angeles", "original_purchase_date":"2015-05-12 11:50:11 Etc/GMT", "original_purchase_date_ms":"1431431411000", "original_purchase_date_pst":"2015-05-12 04:50:11 America/Los_Angeles", "expires_date":"2015-05-12 11:57:01 Etc/GMT", "expires_date_ms":"1431431821000", "expires_date_pst":"2015-05-12 04:57:01 America/Los_Angeles", "web_order_line_item_id":"100000002973149", "is_trial_period":"false"},
{"quantity":"1", "product_id":"subscription.A", "transaction_id":"100000015494558", "original_transaction_id":"100000015494368", "purchase_date":"2015-05-12 11:57:01 Etc/GMT", "purchase_date_ms":"1431431821000", "purchase_date_pst":"2015-05-12 04:57:01 America/Los_Angeles", "original_purchase_date":"2015-05-12 11:55:03 Etc/GMT", "original_purchase_date_ms":"1431431703000", "original_purchase_date_pst":"2015-05-12 04:55:03 America/Los_Angeles", "expires_date":"2015-05-12 12:02:01 Etc/GMT", "expires_date_ms":"1431432121000", "expires_date_pst":"2015-05-12 05:02:01 America/Los_Angeles", "web_order_line_item_id":"100000002973151", "is_trial_period":"false"},
{"quantity":"1", "product_id":"subscription.A", "transaction_id":"100000015494630", "original_transaction_id":"100000015494368", "purchase_date":"2015-05-12 12:02:01 Etc/GMT", "purchase_date_ms":"1431432121000", "purchase_date_pst":"2015-05-12 05:02:01 America/Los_Angeles", "original_purchase_date":"2015-05-12 12:00:29 Etc/GMT", "original_purchase_date_ms":"1431432029000", "original_purchase_date_pst":"2015-05-12 05:00:29 America/Los_Angeles", "expires_date":"2015-05-12 12:07:01 Etc/GMT", "expires_date_ms":"1431432421000", "expires_date_pst":"2015-05-12 05:07:01 America/Los_Angeles", "web_order_line_item_id":"100000002973153", "is_trial_period":"false"},
...
When the subscription extends to a different duration, I think it'll of course have product_id subscription.B
, but will it have a new original_transaction_id
, or will that still be connected to (in this case) 100000015494368
?
Since I cannot access the iTunes settings with sandbox test users, I have no idea how to test it, and I couldn't find a clear statement it in the documentation.