gpt4 book ai didi

安卓订阅状态

转载 作者:行者123 更新时间:2023-11-29 02:36:37 27 4
gpt4 key购买 nike

今天谷歌宣布了新功能 - “拒绝付款的帐户保留”https://developer.android.com/google/play/billing/billing_subscriptions.html

要使用此功能,开发人员需要实现对它的支持。在这种情况下,我有一个问题,如何确定是宽限期(谷歌尝试收取款项时的 3 天或 7 天)还是“帐户因拒绝付款而保留”状态?

我在文档中找不到此信息。

Google 提供下一个订阅信息:

{
"kind": "androidpublisher#subscriptionPurchase",
"startTimeMillis": long,
"expiryTimeMillis": long,
"autoRenewing": boolean,
"priceCurrencyCode": string,
"priceAmountMicros": long,
"countryCode": string,
"developerPayload": string,
"paymentState": integer,
"cancelReason": integer,
"userCancellationTimeMillis": long,
"orderId": string
}

根据文档,“帐户因拒绝付款而保留”状态是:

expiryTimeMillis < current_time &&
autoRenewing = true &&
paymentState = 0

但是什么样的字段状态将决定宽限期呢?

我使用这个值来确定宽限期,但现在看起来是错误的:

expiryTimeMillis < current_time && 
paymentState = 0

最佳答案

根据我从here收集到的信息我假设我的应用程序如下。我们假设宽限期为 7 天,保留期为 30 天。

当用户处于宽限期时

expiryTimeMillis > current_time &&
autoRenewing = true &&
paymentState = 0

当用户在宽限期内解决他们的付款问题时,订阅将恢复,它应该看起来像这样

expiryTimeMillis > current_time &&
autoRenewing = true &&
paymentState = 1

如果用户在 7 天的宽限期后仍未修复他们的付款方式,那么它将看起来像这样

expiryTimeMillis < current_time &&
autoRenewing = true &&
paymentState = 0

如果用户在 Hold Period 之后没有修改他们的付款方式(这里我不确定 Grace Period 的前 7 天是否已经计入 Hold Period,所以 Hold Period 的 30 天 OR 30 - 7 = 23 天的保留期) 那么它看起来像这样

expiryTimeMillis < current_time &&
autoRenewing = false &&
paymentState = 0 &&
cancelReason = 1 # The system canceled the subscription

但如果用户修复了他们的支付方式,那么订阅将恢复正常,看起来像这样

expiryTimeMillis > current_time &&
autoRenewing = true &&
paymentState = 1

简而言之:对于宽限期,expiryTime 总是在未来;对于 Hold Period,expiryTime 是过去的总是

关于安卓订阅状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46584981/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com