关于服务器到服务器通知的问题 [英] Question about server-to-server notification
问题描述
Apple文档在此文档中说: https://developer.apple.com/documentation/appstoreservernotifications/notification_type?changes = _2
As Apple doc said in this doc: https://developer.apple.com/documentation/appstoreservernotifications/notification_type?changes=_2
Subscription event | Notification types triggered
-----------------------------------------------------------------------------
.
.
.
Auto-renewal disabled (canceled) from
the App Store account's Subscriptions settings | DID_CHANGE_RENEWAL_STATUS
AppleCare refund | CANCEL, DID_CHANGE_RENEWAL_STATUS
发生AppleCare <退款> 时,会触发两种通知类型,其中一种是 DID_CHANGE_RENEWAL_STATUS
.并且,当发生取消订阅
时,其通知类型也为 DID_CHANGE_RENEWAL_STATUS
.因此,当我收到一个带有notification_type DID_CHANGE_RENEWAL_STATUS
的通知时,我怎么知道用户是否已已退款
或已取消
?
When AppleCare refund
happend, there are two notification types triggered, one of them is DID_CHANGE_RENEWAL_STATUS
. And when cancel subscription
happened, its notification type is DID_CHANGE_RENEWAL_STATUS
too. So, when i got a notification with notification_type DID_CHANGE_RENEWAL_STATUS
, how could i know whether the user has refunded
or canceled
?
推荐答案
我不知道为什么苹果会触发 CANCEL
以及 DID_CHANGE_RENEWAL_STATUS
,但是技术上是正确的.用户取消其订阅(您将收到 CANCEL
通知),这还将更改续订状态(您将获得 DID_CHANGE_RENEWAL_STATUS
通知-显然,该订阅以后将不会续订).
I don't know why Apple triggers CANCEL
as well as DID_CHANGE_RENEWAL_STATUS
, but technical it is correct. The user cancels his subscription (you get the CANCEL
notification) and this also changes the renewal status (you get the DID_CHANGE_RENEWAL_STATUS
notification—obviously the subscription won't renew in the future).
对于您的问题:当您收到 CANCEL
通知,并且带有 DID_CHANGE_RENEWAL_STATUS
通知的服务器响应正文包含 cancellation_date_ms 时,您会知道发生了退款.
Latest_receipt_info
中的code>.
To your question: you know a refund happend when you receive the CANCEL
notification and when the server response body with the DID_CHANGE_RENEWAL_STATUS
notification contains the cancellation_date_ms
in Latest_receipt_info
.
cancellation_date_ms
Apple客户支持取消交易的时间和日期,或者用户升级自动续订的时间和日期.
The time and date that Apple customer support canceled a transaction or the time and date the user upgraded an auto-renewable subscription.
有关更多详细信息,请参见此处.
see here for more details.
不用担心用户升级其订阅,您的服务器将另外收到 CANCEL
和 DID_CHANGE_RENEWAL_STATUS
的 INTERACTIVE_RENEWAL
通知
Don't worry in the case that a user upgrades his subscription, your server will receive additionally to CANCEL
and DID_CHANGE_RENEWAL_STATUS
the INTERACTIVE_RENEWAL
notification.
如果用户取消(停用了自动续订)字段 auto_renew_status
(文档)设置为 0
.
In the case the user canceled (deactivated auto-renew) the field auto_renew_status
(documentation) in the response body is set to 0
.
这篇关于关于服务器到服务器通知的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!