Apple IAP 收据/状态通知中 cancellation_date 字段的格式是什么

What is the format of the cancellation_date field in Apple IAP receipt / status notifications

有关服务器到服务器通知的 Apple 文档未指定 cancellation_date 字段中的数据格式。我正在尝试为我的通知处理程序设置一些单元测试,但我不确定要将哪些数据放入我的模拟响应中。

我假设它是自纪元以来的毫秒数,但在文档中指出其他字段的地方,cancellation_date 字段只是读取,"The time and date that a transaction was cancelled by Apple customer support."

谁能确认 cancellation_date 字段中的日期格式?

我今天确实找到了这个:

if the receipt status is 21006 and there is a key named cancellation_date, then it’s a cancellation, you can find the new expiration date in that key but it’s a formatted date, if you need a better value to parse check for receipt['latest_expired_receipt_info']['cancellation_date_ms'] same as expires_date

Notification of cancellation of auto-renewal for an in-app purchase

我现在也在生产中证实了这一点。有一个 cancellation_date_ms 属性 of latest_expired_receipt_info 并且也在通知本身的根目录中。 cancellation_date 是格式化的日期字符串。

这是部分生产通知:

{ "environment": "PROD", "auto_renew_status": "false", "latest_expired_receipt_info": { "original_purchase_date_pst": "2018-01-25 11:59:25 America/Los_Angeles", "cancellation_date_ms": "1517150504000", "cancellation_reason": "0", "original_purchase_date_ms": "1516910365000", "expires_date_formatted": "2019-01-25 19:59:23 Etc/GMT", "is_in_intro_offer_period": "false", "purchase_date_ms": "1516910363000", "expires_date_formatted_pst": "2019-01-25 11:59:23 America/Los_Angeles", "is_trial_period": "false", "expires_date": "1548446363000", "cancellation_date": "2018-01-28 14:41:44 Etc/GMT", "purchase_date": "2018-01-25 19:59:23 Etc/GMT", "cancellation_date_pst": "2018-01-28 06:41:44 America/Los_Angeles", "purchase_date_pst": "2018-01-25 11:59:23 America/Los_Angeles", "original_purchase_date": "2018-01-25 19:59:25 Etc/GMT" }, "cancellation_date_ms": "1517150504000" }