Android-inapp-billing-v3: Question: Upgrade of subscriptions not charged.

Created on 21 Nov 2019  路  3Comments  路  Source: anjlab/android-inapp-billing-v3

Hello , I have an application which has 5 packs of subscriptions. I allow users to downgrade/upgrade its subscriptions by using
bp.updateSubscription((Activity) mcontext,ownedProduct,newProduct);
But 1. pack is 1 dollar and 5.pack is 20 dollars. When user bought a first pack then upgrade to 5th pack is not charging...

After making some research I realized i have to set proration mode for upgrade.
IMMEDIATE_AND_CHARGE_PRORATED_PRICE
i have to pass this parameter on updateSubscription to charge user again. But i dont know how to pass this parameter in updateSubscription

Thanks , Best regards.

Most helpful comment

Solved. I'm sending this bundle as a extra.

                   Bundle b = new Bundle();
                    b.putInt("prorationMode",2); // 2 is IMMEDIATE_AND_CHARGE_PRORATED_PRICE

All 3 comments

Solved. I'm sending this bundle as a extra.

                   Bundle b = new Bundle();
                    b.putInt("prorationMode",2); // 2 is IMMEDIATE_AND_CHARGE_PRORATED_PRICE

@mahirozdin What method specifically were you sending this bundle into?

String oldpack = ownedProducts.get(0);
                        String nextpack = travelModelArrayList.get(position).getPack_id();
                        int oldpackinumber =  Integer.parseInt(stripNonDigits(oldpack));
                        int nextpackinumber =  Integer.parseInt(stripNonDigits(nextpack));


                    for(String pack:ownedProducts){
                        Log.d("Avc谋", "onClick: "+pack);
                    }
                        if(nextpackinumber  > oldpackinumber){
                            Bundle b = new Bundle();
                            b.putInt("prorationMode",2);

                            bp.updateSubscription((Activity) mcontext,ownedProducts,travelModelArrayList.get(position).getPack_id(),null, b);
                        }else{
                            Bundle b = new Bundle();
                            b.putInt("prorationMode",4);
                            bp.updateSubscription((Activity) mcontext,ownedProducts,travelModelArrayList.get(position).getPack_id(),null, b);
                        }

I'm using something like that. If pack is bigger downgrade else upgrade

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AbanoubWagdyWahib picture AbanoubWagdyWahib  路  9Comments

mattiaferigutti picture mattiaferigutti  路  6Comments

beshoo picture beshoo  路  3Comments

KRIPT4 picture KRIPT4  路  3Comments

najam-amfnrh9 picture najam-amfnrh9  路  6Comments