Hi there,
My understanding is that you are creating a new CheckoutSession object in `mode:"subscription"` and creating a whole separate new Subscription for the pro plan, and then cancelling the Customer's existing Subscription.
What I'd suggest doing instead is updating the existing Subscription, not creating a new one. That makes it much easier to handle your use case of charging a prorated amount.
The easiest option would be to let the customer make the change in the Customer Portal [0] [1] . You can configure that the update will calculate proration, and the portal will handle the payment processing for any invoice created as a result.
Alternatively it's also possible to update the subscription directly [2] , where you can use the `proration_behavior:"always_invoice"` parameter to force calculation of proration and charging the customer's default payment method for the change.
If you have any more questions or problems in implementing this I'd suggest opening a support case at
https://support.stripe.com/?contact=true with the code you're using and example Subscription IDs `sub_xxx` and we can help!
I hope this helps but please do not hesitate to get back to me if you need more details.
All the best,
Kyle