I am trying to implement the Server-to-Server Notifications for IOS subscriptions. I have went through the Server-to-Server Notifications documentation and followed all the necessary steps. My server is in the GCM.
Now when i do a purchase in the app i am getting the notification in my server, but the response is totally different from the which is defined in the above link.
The response which i am getting contains only one field that is latest_receipt . But in the documentation they have mentioned various parameters. So, i thought i have to verify the receipt by send a post message to this endpoint . Now i am getting a json body which contains lot of information, but still i am not getting the json which is mentioned in the documentation.
The response body i am getting after verifying the purchase ( https://sandbox.itunes.apple.com/verifyReceipt)
{
"auto_renew_status": 1,
"status": 0,
"auto_renew_product_id": " ",
"receipt": {
"original_purchase_date_pst": "2019-01-09 01:26:35 America/Los_Angeles",
"quantity": "1",
"unique_vendor_identifier": " ",
"bvrs": "56",
"expires_date_formatted": "2019-07-18 06:19:17 Etc/GMT",
"is_in_intro_offer_period": "false",
"purchase_date_ms": "1563430577000",
"expires_date_formatted_pst": "2019-07-17 23:19:17 America/Los_Angeles",
"is_trial_period": "false",
"item_id": "1298435177",
"unique_identifier": " ",
"original_transaction_id": "1000000492823158",
"expires_date": "1563430757000",
"transaction_id": "1000000548145129",
"web_order_line_item_id": "1000000045717939",
"version_external_identifier": "0",
"bid": " ",
"product_id": " ",
"purchase_date": "2019-07-18 06:16:17 Etc/GMT",
"original_purchase_date": "2019-01-09 09:26:35 Etc/GMT",
"purchase_date_pst": "2019-07-17 23:16:17 America/Los_Angeles",
"original_purchase_date_ms": "1547025995000"
},
"latest_receipt_info": {
"original_purchase_date_pst": "2019-01-09 01:26:35 America/Los_Angeles",
"unique_identifier": " ",
"original_transaction_id": "1000000492823158",
"expires_date": "1563430757000",
"transaction_id": "1000000548145129",
"quantity": "1",
"product_id": " ",
"bvrs": "56",
"bid": " ",
"unique_vendor_identifier": " ",
"web_order_line_item_id": "1000000045717939",
"original_purchase_date_ms": "1547025995000",
"expires_date_formatted": "2019-07-18 06:19:17 Etc/GMT",
"purchase_date": "2019-07-18 06:16:17 Etc/GMT",
"is_in_intro_offer_period": "false",
"purchase_date_ms": "1563430577000",
"expires_date_formatted_pst": "2019-07-17 23:19:17 America/Los_Angeles",
"is_trial_period": "false",
"purchase_date_pst": "2019-07-17 23:16:17 America/Los_Angeles",
"original_purchase_date": "2019-01-09 09:26:35 Etc/GMT",
"item_id": "1298435177"
}
}
But in the documentation they have mentioned :
environment
notification_type
password
cancellation_date
cancellation_date_pst
cancellation_date_ms
web_order_line_item_id
latest_receipt
latest_receipt_info
latest_expired_receipt
latest_expired_receipt_info
auto_renew_status
auto_renew_product_id
auto_renew_status_change_date
auto_renew_status_change_date_pst
auto_renew_status_change_date_ms
I am not getting the main fields such as environment and notification_type.
Whats wrong in it ?
For the first time this is the response i am getting
{ latest_receipt: 'ewoJInNpZ25hdHVyZ'}
The response which i am getting from the server 2 server notification is on the second time (once its renewed):
{ environment: 'Sandbox',
auto_renew_status: 'false',
latest_expired_receipt: 'ewoJIn'
}