3

Today google announced new feature - "Account holds for declined payments" https://developer.android.com/google/play/billing/billing_subscriptions.html

To use this feature developers need to implement support of it. In this case I have a question how to determine is it the grace period (3 or 7 days while google trys to charge money) or is it "Account holds for declined payments" state?

I can't find this information in doc.

Google provide next subscription information:

{
  "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
}

According to doc the "Account holds for declined payments" state is:

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

But what state of fields will determines the grace period?

I am using this values for determine grace period but now it looks like wrong:

expiryTimeMillis < current_time && 
paymentState = 0
Nik
  • 7,114
  • 8
  • 51
  • 75

1 Answers1

0

According to the information that I gathered from here I'm assuming for my app the following. We assume a Grace Period of 7 days and a Hold Period of 30 days.

The User is in Grace Period when

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

When the user fixes their payment during the Grace Period then the subscription is resumed and it should look like this

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

If the user doesn't fix their payment method after 7 days of Grace Period then it would look like this

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

If the user doesn't fix their payment method after the Hold Period (here I'm not sure if the first 7 days of Grace Period already count against the Hold Period, so either 30 days of Hold Period OR 30 - 7 = 23 days of Hold Period) then it would look like this

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

But if the user fixed their payment method then the subscription would resume as normal and look like this

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

In short: for Grace Period the expiryTime is always in the future; for Hold Period the expiryTime is always in the past.

Bernd Kampl
  • 4,837
  • 4
  • 21
  • 26