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.
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
Most helpful comment
Solved. I'm sending this bundle as a extra.