#rohit-subscription-upgrades
1 messages · Page 1 of 1 (latest)
Hello, not quite sure I understand the end goal. Are you looking to add a plan or update the existing one on a Checkout session that the user has not completed yet?
I am using above action to subscribe on signup. User signup with free plan where I am passing price id of free plan.
Inside the app, when user try to upgrade to paid plan. I am using same above action but passing the paid product price id. And it create one more subscription.
If the user has already completed their Checkout Session and has a subscription on the free plan, that would mean you would want to update that existing subscription to be on the paid plan price
https://stripe.com/docs/billing/subscriptions/upgrade-downgrade
But it wont allow user to open stripe checkout page. The below method directly upgrade
`subscription = Stripe::Subscription.retrieve('sub_49ty4767H20z6a')
Stripe::Subscription.update(
subscription.id,
{
cancel_at_period_end: false,
proration_behavior: 'create_prorations',
items: [
{
id: subscription.items.data[0].id,
price: 'price_CBb6IXqvTLXp3f'
}
]
}
)`
What does "it won't allow a user to open stripe checkout page" mean? Checkout is for creating Subscriptions nothing else, it never works on upgrades
rohit-subscription-upgrades
Ok, so the above checkout action cant be used to update existing subscription. ?
correct
https://stripe.com/docs/customer-management I recommend looking at this which is our hosted page/product for managing you customers and their subscriptions
@abstract raptor did you have more questions?
No. All good. tHANKS