#vickygiyst
1 messages ยท Page 1 of 1 (latest)
Stripe allows multiple subscriptions to exist for the same customer, so yes it would be possible for your integration to do this
How are your subscriptions created now? Do you have a payment link or something set up?
yes, i have products created on strip and i m using the price_id on web portal for purchase
can you tell me how to do that?
because under manage subscription, that renew subscription comes only when existing ends
Can you tell me more about what you are trying to do? Are you asking how to allow them to purchase a new subscription?
yes correct !. basically what i want is to cancel their exiting subscription if the limit exceeds . so that they can go to manage subscription page (provided from stripe this) and purchase a new one
if you can tell me, how can i cancel their subscription through api manually
You can cancel the subscription with this API call https://stripe.com/docs/api/subscriptions/cancel
Stripe's Customer Portal cannot create new subscriptions though, so you would have to create a new Checkout Session for the user to get a new subscription
you mean the cancel plan button on this page will not show- buy a new plan if i will cancel the subscription manually
Hello ๐
Taking over as Pompey needs to step away soon
Hi Hanzo
The cancel plan button should still be rendered on the customer portal page. I think what Pompey meant was that it can't start a new subscription when the customer cancels the old subscription via the portal
So you'd need to handle that using a Checkout Session OR via the API
does that clarify?
no, what i m thinking is , if i will cancel the subscription through stripe API , then on customer portal page this cancel button should be changed to Renew Subscription
is it not the case
like tghis
Ah, yeah if you've already cancelled then the customer portal shouldn't show the "cancel" button anymore
I think it depends on how exactly you're cancelling, the screenshot version seems like that the plan cancels at the end of current period vs immediate cancellation.
I'm trying to run a quick test but if you have some test subscriptions then you can test this out too. My understanding is that if you cancel immediately (and not at the period end) then there shouldn't be a subscription listed under current plan
My understanding is that if you cancel immediately (and not at the period end) then there shouldn't be a subscription listed under current plan
Yup that's exactly what happens.
First screenshot is when I have an active sub and the second is when I cancel it immediately. There's no current plan section on the page
Since I reused a test customer, its showing a past due invoice from before, in your case if the customer doesn't have any past due invoices then there won't be an outstanding section on the page either
i have canceled this particular subscription and when i went to portal session, there's no button as renew subscription or buy subscription
so , there's no way for user to purchase a subscription by visiting this api from strip -- https://billing.stripe.com/p/session/test_YWNjdF8xTWpPeHhLR0UwWWxKMDE1LF9OZ2pFekluSzBKY3J0ZDJzcUY2QmFUS1o5dFc1d0M50100xFPaBrEr
That's correct. You can only cancel/upgrade/renew using Customer Portal.
You can't start new subscriptions all together
oh okay !
so then stripe.checkout.sessions.create is the only option left?
to buy a new suscription
That's one option. The other is you call the create subscription API directly & build your own UI
https://stripe.com/docs/api/subscriptions/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
i see ,this is directly creating a subscription without asking the payment details. so does that mean it will auto debit the money from the existing payment method?
Yes as long as it is set as default on the customer.invoice_settings.default_payment_method
is it something which is controlled by developer or the customer?
You as a developer can set this by calling the API. Typically folks set this when a PaymentMethod is generated initially.
is there any doc to refer this
hmm checking..
There's a blurb here
https://stripe.com/docs/api/payment_methods/attach