【问题标题】:Android subscription status安卓订阅状态
【发布时间】:2018-03-17 00:50:11
【问题描述】:

今天谷歌宣布了新功能——“账户被拒付款”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

【问题讨论】:

  • 你有想过宽限期组合吗?我面临同样的事情。
  • @jmichas 不,我暂停了这项任务的工作,直到找到有关此的信息

标签: android in-app-billing subscription


【解决方案1】:

根据我从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

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

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 是 always 过去的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多