Skip to main content

Hi community,

I’m stuck with the subscription product change before expiration. How to implement it in my android app (preferably in java)? All other operations are well executed through the paywall, except the product change. Unfortunately, it charges the new chosen plan at full price (instead a calculated pro rata up to the expiration date) and does not cancel the prior one. 

I asked to chatGPT, but there were a lot of issues with their suggested codes. I gave up with AI after more than 6 hours trying their codes. Each of their corrections generate new issues.

Is there someone here who can help me?

Ben

Hi ​@BenoitDuvivier,

Just to clarify, you are showing your paywall to subscribed users so they can update/downgrade/crossgrade their subscription to a different plan - which is not working as expected with Paywalls v2, is that correct?

Best,

 

 


Hi Joan,

 

Thanks for your reply, yes you are right, but in the meantime, I found the solution, I added the following lines in my code:

GoogleReplacementMode replacementMode = GoogleReplacementMode        .CHARGE_PRORATED_PRICE;       PurchaseParams params = new PurchaseParams.Builder(activity, selectedPackage)            .oldProductId(currentProductId)            .googleReplacementMode(replacementMode)            .build();

Thanks again for your help,

Ben