我正在通过Google Developer Subscription Purchase的响应中的以下链接查看此文档:
https://developers.google.com/android-publisher/api-ref/purchases/subscriptions#methods
具体来说,对于字段linkedPurchaseToken
,提到了两种情况:
我不确定情况#1何时发生。尝试购买,取消和还原(虽然没有失效)自动续订的订阅,但是还原后,我在响应中没有得到linkedPurchaseToken。
以下是三种情况下的答复:
购买后:
{
"kind": "androidpublisher#subscriptionPurchase",
"startTimeMillis": "1573546099994",
"expiryTimeMillis": "1573548136296",
"autoRenewing": true,
"priceCurrencyCode": "INR",
"priceAmountMicros": "85000000",
"countryCode": "IN",
"developerPayload": "",
"paymentState": 1,
"orderId": "GPA.3359-7048-7648-05268",
"purchaseType": 0,
"acknowledgementState": 1
}
取消后:
{
"kind": "androidpublisher#subscriptionPurchase",
"startTimeMillis": "1573546099994",
"expiryTimeMillis": "1573548016296",
"autoRenewing": false,
"priceCurrencyCode": "INR",
"priceAmountMicros": "85000000",
"countryCode": "IN",
"developerPayload": "",
"paymentState": 1,
"cancelReason": 0,
"userCancellationTimeMillis": "1573546553870",
"cancelSurveyResult": {
"cancelSurveyReason": 0
},
"orderId": "GPA.3359-7048-7648-05268",
"purchaseType": 0,
"acknowledgementState": 1
}
还原后:
{
"kind": "androidpublisher#subscriptionPurchase",
"startTimeMillis": "1573546099994",
"expiryTimeMillis": "1573548136296",
"autoRenewing": true,
"priceCurrencyCode": "INR",
"priceAmountMicros": "85000000",
"countryCode": "IN",
"developerPayload": "",
"paymentState": 1,
"orderId": "GPA.3359-7048-7648-05268",
"purchaseType": 0,
"acknowledgementState": 1
}
在什么情况下应该为#1情景获取LinkedPurchaseToken吗?
答案 0 :(得分:1)
Re-signup of a canceled but non-lapsed subscription
:
从Play商店取消订阅后->订阅,您可以通过两种方式重新订阅/重新注册-
1)从应用内重新订阅-购买令牌不同,Developer API for Subscription Purchases
会在有linkedPurchaseToken
的情况下给出响应。
You can allow users to resubscribe within your app by applying the same in-app product purchase flow as with a cancelled subscription by using the same product ID.
如here所述。
2)从Play商店还原-将按原样还原。在这种情况下,购买令牌是相同的,因此在这种情况下,您将不会获得linkedPurchaseToken
。