#rohit-subscription-upgrades

1 messages · Page 1 of 1 (latest)

ionic haloBOT
stiff forum
#

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?

abstract raptor
#

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.

stiff forum
abstract raptor
#

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'
}
]
}
)`

unreal kite
#

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

abstract raptor
#

Ok, so the above checkout action cant be used to update existing subscription. ?

unreal kite
#

correct

unreal kite
#

@abstract raptor did you have more questions?

abstract raptor
#

No. All good. tHANKS