#Pavan-subs-update
1 messages · Page 1 of 1 (latest)
hello @jovial kettle, can you elaborate a bit more on what you're trying to do? Do you mean you want your customer to pay upfront when the subscription is upgraded?
As part of custom flow, we are trying to implement both frontend and backend. Stripe recommendation is Best practices
We recommend creating a PaymentIntent as soon as you know the amount, such as when the customer begins the checkout process, to help track your sales funnel. If the amount changes, you can update its amount. For example, if your customer backs out of the checkout process and adds new items to their cart, you may need to update the amount when they start the checkout process again.
So what we are thinking is in the backend when customer updates quantities, we will update payment Intent of existing invoice of customer and returns secret to frontend
Then frontend updates the subscription using that secret
Is this flow correct ?
One more flow i see is https://stripe.com/docs/billing/subscriptions/upgrade-downgrade
i think this is the doc you should reference : https://stripe.com/docs/billing/subscriptions/elements
if you support upgrade/downgrades then yes, you should take a look at https://stripe.com/docs/billing/subscriptions/upgrade-downgrade too
This doc i am aware, i am trying to understand can we update via PaymentIntent ? If it is not possible why it is not ?
no, you shouldn't update the PaymentIntent directly. The workflow which you mentioned is more applicable to a non-subscription based checkout.
Ultimately, what you're dealing with is the subscription and you should make updates to the Subscription object itself.
If the user is subscribing to more than one subscription, each subscription will create an invoice which will have it's own underlying PaymentIntent.
So each PaymentIntent will need to be paid separately for each subscription to be "activated"
Just understanding relation between subscription, Invoice and PaymentIntent. If it is monthly subscription then every month an invoice will generated which generates PaymentIntent for collection of payment ?
cc @broken stirrup
yes you're correct
Can you explain more on PaymentIntent ?
Payment Intents represent the state of all attempts to pay an invoice. I got this from doc
I think this section covers the bit about how PaymentIntent state relates to invoice and subscription state - https://stripe.com/docs/billing/subscriptions/overview#payment-status
let me know if you have specific questions