首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Apple接收/状态通知中的cancellation_date字段的格式是什么?

Apple接收/状态通知中的cancellation_date字段的格式是什么?
EN

Stack Overflow用户
提问于 2017-10-25 20:26:55
回答 1查看 1.7K关注 0票数 4

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

我假设从纪元开始已经是毫秒了,但是在文档中其他字段都是这样的,cancellation_date字段只是读到,“交易被苹果客户支持部门取消的时间和日期。”

有人能确认cancellation_date字段中的日期格式吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-01-29 08:25:20

我今天确实找到了这个:

如果收据状态为21006,并且有一个名为cancellation_date的键,则可以在该键中找到新的过期日期,但这是一个格式化的日期,如果您需要一个更好的值来解析是否收到了与expires_date相同的收据‘最新_过期_接收_info’

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

我现在也在生产中证实了这一点。在通知本身的根目录中有一个cancellation_date_ms属性latest_expired_receipt_infocancellation_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" }

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46941493

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档