question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Billing V5: change between 2 renewable base plans of the same subscription

See original GitHub issue

I am migrating the Android Billing Library from V4 to V5 and I cannot use the method BillingClient#launchBillingFlow to change between 2 renewable base plans of the same subscription. It returns the error Error retrieving information from server. DF-DFERH-01. Below is my implementation:

        BillingFlowParams.SubscriptionUpdateParams subscriptionUpdateParams =
                BillingFlowParams.SubscriptionUpdateParams.newBuilder()
                .setOldPurchaseToken(oldPurchaseToken)
                .build();

        List<BillingFlowParams.ProductDetailsParams> productDetailsParams = new ArrayList<>();
        productDetailsParams.add(BillingFlowParams.ProductDetailsParams.newBuilder()
                .setProductDetails(productDetails)
                .setOfferToken(offerToken)
                .build());

        BillingFlowParams billingFlowParams = BillingFlowParams.newBuilder()
                    .setSubscriptionUpdateParams(subscriptionUpdateParams)
                    .setProductDetailsParamsList(productDetailsParams)
                    .build();
        mBillingClient.launchBillingFlow(activity, billingFlowParams);

The official introduction about the new Billing structure mentioned the ability to change between 2 renewable base plans of the same subscription in their example:

In the PlayBillingCodelab sample app, when a user purchased a renewable plan, there is no option to upgrade/downgrade to another renewable plan in the same subscription. (PlayBillingCodelab MainActivity.kt line 127)

So which one is correct? In the new subscription structure, can the user change between 2 renewable base plans of the same subscription?

z3509093390942_7310ed5e0bc9b861620046806e7f9470 image

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:7
  • Comments:9

github_iconTop GitHub Comments

3reactions
RetRo99commented, Jul 13, 2022

@tuan25abc @SamYStudiO I faced the same issue. It is only possible to change base plan of the same subscription with the ProrationMode.IMMEDIATE_WITHOUT_PRORATION and ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE

1reaction
matalecommented, Jun 23, 2022

It is supported. It could be the fact that you didn’t set a proration mode or something is wrong with the tokens, the old token must be the purchase token of the existing subscription while the new token is the offer token. See https://github.com/android/play-billing-samples/blob/3f34105c34e2ed2e88055ccf2b04088e8a5fd3a2/ClassyTaxiAppKotlin/app/src/main/java/com/example/subscriptions/ui/BillingViewModel.kt#L145

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Play Billing Library 4 to 5 Migration Guide
You can consolidate duplicate products in your old catalog representing the same entitlement benefits under a single subscription and use base ...
Read more >
How to switch between base plans of same subscription in V5 ...
We wish to enable our users to select/switch between base plans representing different billing cycle (Monthly, yearly). But without knowing what ...
Read more >
Understanding subscriptions - Play Console Help - Google Help
Users can purchase an auto-renewing base plan to obtain subscription entitlement for a specified billing period, with automatic charges and entitlement ...
Read more >
Sell subscriptions in app with the Play Billing Library 5
As shown in figure 1, in this app the user signs up for any of the base plans and/or offers offered through two...
Read more >
Migrating to Billing Library 5 - YouTube
Google Play added new subscription features in May 2022 and released Billing Library 5. Learn how to adapt your Android and server ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found