我正在开发一个提供自动续订订阅的应用程序。
subscription.A
如果用户已购买(7 天后更新),我不知道在验证收据哈希时来自 Apple 的 JSON 响应会是什么样子,然后转到他的 iTunes 设置并将其更改为subscription.B
从同一个订阅系列更新。
因为subscription.A
更新几次后会是这样的:
...
{"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"},
...
当订阅延长到不同的持续时间时,我认为它当然会有 product_id subscription.B
,但它会有一个 new original_transaction_id
,还是仍会连接到(在这种情况下)100000015494368
?
由于我无法通过沙盒测试用户访问 iTunes 设置,因此我不知道如何对其进行测试,也无法在文档中找到明确的说明。