Я впервые пытался оформить подписку с оплатой Apple и до сих пор получил это json от https://buy.itunes.apple.com/verifyReceipt
конечной точки.
"status": 0,
"environment": "Sandbox",
"receipt": {
"receipt_type": "ProductionSandbox",
"adam_id": 0,
"app_item_id": 0,
"bundle_id": "some.company",
"application_version": "101",
"download_id": 0,
"version_external_identifier": 0,
"receipt_creation_date": "2020-05-26 17:04:59 Etc/GMT",
"receipt_creation_date_ms": "1590512699000",
"receipt_creation_date_pst": "2020-05-26 10:04:59 America/Los_Angeles",
"request_date": "2020-05-26 17:20:25 Etc/GMT",
"request_date_ms": "1590513625181",
"request_date_pst": "2020-05-26 10:20:25 America/Los_Angeles",
"original_purchase_date": "2013-08-01 07:00:00 Etc/GMT",
"original_purchase_date_ms": "1375340400000",
"original_purchase_date_pst": "2013-08-01 00:00:00 America/Los_Angeles",
"original_application_version": "1.0",
"in_app": [
{
"quantity": "1",
"product_id": "some.company.1monthAuto",
"transaction_id": "1000000666860015",
"original_transaction_id": "1000000666860015",
"purchase_date": "2020-05-19 11:47:47 Etc/GMT",
"purchase_date_ms": "1589888867000",
"purchase_date_pst": "2020-05-19 04:47:47 America/Los_Angeles",
"original_purchase_date": "2020-05-19 11:47:47 Etc/GMT",
"original_purchase_date_ms": "1589888867000",
"original_purchase_date_pst": "2020-05-19 04:47:47 America/Los_Angeles",
"expires_date": "2020-05-19 11:52:47 Etc/GMT",
"expires_date_ms": "1589889167000",
"expires_date_pst": "2020-05-19 04:52:47 America/Los_Angeles",
"web_order_line_item_id": "1000000052593700",
"is_trial_period": "false",
"is_in_intro_offer_period": "false"
},
{
"quantity": "1",
"product_id": "some.company.1monthAuto",
"transaction_id": "1000000666862234",
"original_transaction_id": "1000000666860015",
"purchase_date": "2020-05-19 11:52:47 Etc/GMT",
"purchase_date_ms": "1589889167000",
"purchase_date_pst": "2020-05-19 04:52:47 America/Los_Angeles",
"original_purchase_date": "2020-05-19 11:47:47 Etc/GMT",
"original_purchase_date_ms": "1589888867000",
"original_purchase_date_pst": "2020-05-19 04:47:47 America/Los_Angeles",
"expires_date": "2020-05-19 11:57:47 Etc/GMT",
"expires_date_ms": "1589889467000",
"expires_date_pst": "2020-05-19 04:57:47 America/Los_Angeles",
"web_order_line_item_id": "1000000052593701",
"is_trial_period": "false",
"is_in_intro_offer_period": "false"
},
{
"quantity": "1",
"product_id": "some.company.1monthAuto",
"transaction_id": "1000000666864921",
"original_transaction_id": "1000000666860015",
"purchase_date": "2020-05-19 11:57:47 Etc/GMT",
"purchase_date_ms": "1589889467000",
"purchase_date_pst": "2020-05-19 04:57:47 America/Los_Angeles",
"original_purchase_date": "2020-05-19 11:47:47 Etc/GMT",
"original_purchase_date_ms": "1589888867000",
"original_purchase_date_pst": "2020-05-19 04:47:47 America/Los_Angeles",
"expires_date": "2020-05-19 12:02:47 Etc/GMT",
"expires_date_ms": "1589889767000",
"expires_date_pst": "2020-05-19 05:02:47 America/Los_Angeles",
"web_order_line_item_id": "1000000052593843",
"is_trial_period": "false",
"is_in_intro_offer_period": "false"
},
... A lot more of these
]
},
"latest_receipt_info": [
{
"quantity": "1",
"product_id": "some.company.1monthAuto",
"transaction_id": "1000000666860015",
"original_transaction_id": "1000000666860015",
"purchase_date": "2020-05-19 11:47:47 Etc/GMT",
"purchase_date_ms": "1589888867000",
"purchase_date_pst": "2020-05-19 04:47:47 America/Los_Angeles",
"original_purchase_date": "2020-05-19 11:47:47 Etc/GMT",
"original_purchase_date_ms": "1589888867000",
"original_purchase_date_pst": "2020-05-19 04:47:47 America/Los_Angeles",
"expires_date": "2020-05-19 11:52:47 Etc/GMT",
"expires_date_ms": "1589889167000",
"expires_date_pst": "2020-05-19 04:52:47 America/Los_Angeles",
"web_order_line_item_id": "1000000052593700",
"is_trial_period": "false",
"is_in_intro_offer_period": "false",
"subscription_group_identifier": "20637709"
},
{
"quantity": "1",
"product_id": "some.company.1monthAuto",
"transaction_id": "1000000666862234",
"original_transaction_id": "1000000666860015",
"purchase_date": "2020-05-19 11:52:47 Etc/GMT",
"purchase_date_ms": "1589889167000",
"purchase_date_pst": "2020-05-19 04:52:47 America/Los_Angeles",
"original_purchase_date": "2020-05-19 11:47:47 Etc/GMT",
"original_purchase_date_ms": "1589888867000",
"original_purchase_date_pst": "2020-05-19 04:47:47 America/Los_Angeles",
"expires_date": "2020-05-19 11:57:47 Etc/GMT",
"expires_date_ms": "1589889467000",
"expires_date_pst": "2020-05-19 04:57:47 America/Los_Angeles",
"web_order_line_item_id": "1000000052593701",
"is_trial_period": "false",
"is_in_intro_offer_period": "false",
"subscription_group_identifier": "20637709"
},
{
"quantity": "1",
"product_id": "some.company.1monthAuto",
"transaction_id": "1000000666864921",
"original_transaction_id": "1000000666860015",
"purchase_date": "2020-05-19 11:57:47 Etc/GMT",
"purchase_date_ms": "1589889467000",
"purchase_date_pst": "2020-05-19 04:57:47 America/Los_Angeles",
"original_purchase_date": "2020-05-19 11:47:47 Etc/GMT",
"original_purchase_date_ms": "1589888867000",
"original_purchase_date_pst": "2020-05-19 04:47:47 America/Los_Angeles",
"expires_date": "2020-05-19 12:02:47 Etc/GMT",
"expires_date_ms": "1589889767000",
"expires_date_pst": "2020-05-19 05:02:47 America/Los_Angeles",
"web_order_line_item_id": "1000000052593843",
"is_trial_period": "false",
"is_in_intro_offer_period": "false",
"subscription_group_identifier": "20637709"
},
{
"quantity": "1",
"product_id": "some.company.1monthAuto",
"transaction_id": "1000000666868029",
"original_transaction_id": "1000000666860015",
"purchase_date": "2020-05-19 12:02:47 Etc/GMT",
"purchase_date_ms": "1589889767000",
"purchase_date_pst": "2020-05-19 05:02:47 America/Los_Angeles",
"original_purchase_date": "2020-05-19 11:47:47 Etc/GMT",
"original_purchase_date_ms": "1589888867000",
"original_purchase_date_pst": "2020-05-19 04:47:47 America/Los_Angeles",
"expires_date": "2020-05-19 12:07:47 Etc/GMT",
"expires_date_ms": "1589890067000",
"expires_date_pst": "2020-05-19 05:07:47 America/Los_Angeles",
"web_order_line_item_id": "1000000052594021",
"is_trial_period": "false",
"is_in_intro_offer_period": "false",
"subscription_group_identifier": "20637709"
},
... A lot more of these
{
"quantity": "1",
"product_id": "some.company.12monthAuto",
"transaction_id": "1000000668810128",
"original_transaction_id": "1000000666860015",
"purchase_date": "2020-05-22 17:47:45 Etc/GMT",
"purchase_date_ms": "1590169665000",
"purchase_date_pst": "2020-05-22 10:47:45 America/Los_Angeles",
"original_purchase_date": "2020-05-19 11:47:47 Etc/GMT",
"original_purchase_date_ms": "1589888867000",
"original_purchase_date_pst": "2020-05-19 04:47:47 America/Los_Angeles",
"expires_date": "2020-05-22 18:47:45 Etc/GMT",
"expires_date_ms": "1590173265000",
"expires_date_pst": "2020-05-22 11:47:45 America/Los_Angeles",
"web_order_line_item_id": "1000000052700844",
"is_trial_period": "false",
"is_in_intro_offer_period": "false",
"subscription_group_identifier": "20637709"
}
],
"latest_receipt": "TOKEN"
"pending_renewal_info": [
{
"expiration_intent": "1",
"auto_renew_product_id": "some.company.12monthAuto",
"original_transaction_id": "1000000666860015",
"is_in_billing_retry_period": "0",
"product_id": "some.company.12monthAuto",
"auto_renew_status": "0"
}
]
}
Как видите, in_app
имеет много дубликатов или некоторую избыточную информацию, а latest_receipt_info
также имеет дубликаты. Поэтому я совершенно не понимаю, что мне следует использовать. Следует ли использовать последний срок годности? Или отфильтровать до первого original_transaction_id
и использовать его даты?
Я хочу получить от заданного receipt-data
, который я передаю на https://buy.itunes.apple.com/verifyReceipt
, дату покупки и дату истечения срока, поэтому я буду обрабатывать их на своей стороне сервера.
Любая помощь будет оценена :)