Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In App Billing error when upgrading subscription plan - “Error while retrieving information from server [DF-DFERH-01]”

Our app has 3 possible auto-renewing subscription plans - monthly, 6 months and yearly. They are defined in Google Play and work well when purchasing.

Recently, we've added an option to change plan using the new API - https://developer.android.com/google/play/billing/billing_subscriptions#Allow-upgrade

For downgrades (shorter subscription period), we use DEFERRED proration mode. For upgrades, we use IMMEDIATE_AND_CHARGE_PRORATED_PRICE.

During our tests, we've discovered that all changes work fine, except when changing "6 months" into "yearly". Whenever we do that (user already has 6 month subscription, trying to change to yearly), instead of getting the normal purchase flow, we get an error. The displayed error message is

"Error while retrieving information from server [DF-DFERH-01]"

The actual error code that we receive from the library is SERVICE_UNAVAILABLE.

Again - all other flows work right, such as monthly -> yearly, monthly -> 6 months.

There is a lack of documentation and clarity about what's going on, and logcat is not showing anything useful.

like image 778
SirKnigget Avatar asked Dec 17 '19 04:12

SirKnigget


People also ask

What does Error Code DF Dferh 01 mean?

If the cache and data of Google Play Store (or any other related apps) are corrupt, then the Play Store may fail to access modules essential for its operation and may result in the error DF-DFERH-01. In such a case, clearing the cache/data of the Google Play Store and other related apps may solve the problem.


1 Answers

As far as I can tell from your question, I'd guess that the longer lasting subscriptions have a lower price per month than e.g. the one month subscription.

The Documentation

For the Proration Mode IMMEDIATE_AND_CHARGE_PRORATED_PRICE the example in the documentation says:

This mode can be used because the Tier 2 subscription price per time unit ($36/year = $3/month) is greater than Tier 1 subscription price per time unit ($2/month).

This suggests that you can only use this mode if the cost per month is increasing by the given upgrade. In the free trial documentation beneath this is mentioned:

Note: This option is available only for a subscription upgrade, where the price per unit of time increases

(I guess they somehow forgot to add this Note also to the first Proration Mode description, because it seems to be a restriction with or without a free trail)

Solution

So changing the Proration Mode to e.g. IMMEDIATE_WITH_TIME_PRORATION or whatever fits your requirements seems to be the only solution (as also mentioned by @SirKnigget in the questions thread), asuming your subscription is not getting more expensive with the upgrade.

like image 67
nitro_nitrat Avatar answered Nov 15 '22 02:11

nitro_nitrat