Home » Android » android – How could app server know subscription item will be changed on next renewal?-Exceptionshub

android – How could app server know subscription item will be changed on next renewal?-Exceptionshub

Posted by: admin February 24, 2020 Leave a comment

Questions:

How could the app or app server possibly know if the subscription change is reserved (or pended or deferred) before the actual change happen on next renewal?

Using “com.android.billingclient:billing:2.1.0”,

billingClient.launchBillingFlow(
                    activity,
                    BillingFlowParams.newBuilder()
                        .setOldSku(oldSku, oldToken)
                        .setSkuDetails(skuDetails)
                        .setReplaceSkusProrationMode(BillingFlowParams.ProrationMode.DEFERRED).build()

This billing flow is for changing subscription item as I provided old sku.
After this purchasing flow, I’ve checked that the subscription item has been changed on next renewal. (worked as I expected.)
But I couldn’t find any clue that the current subscription item will be changed before the actual change happens.

I’ve explored some docs, but I couldn’t find much about proration mode, especially about deferred upgrade/downgrade.
Only thing that I found is “payment_state” in https://developers.google.com/android-publisher/api-ref/purchases/subscriptions .

The doc says

paymentState : The payment state of the subscription.

Possible values are

0 : Payment pending,

1 : Payment received,

2 : Free trial,

3 : Pending deferred upgrade/downgrade

So I expected that I receive paymentMethod as value “3”, but what I’ve got is “1 or 2”.

Also I didn’t get any “Developer Realtime Notifications” from google server about this purchase.

How to&Answers: