#Pavan-subs-update

1 messages · Page 1 of 1 (latest)

broken stirrup
#

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?

jovial kettle
#

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 ?

broken stirrup
jovial kettle
#

This doc i am aware, i am trying to understand can we update via PaymentIntent ? If it is not possible why it is not ?

broken stirrup
#

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"

jovial kettle
#

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

broken stirrup
#

yes you're correct

jovial kettle
#

Can you explain more on PaymentIntent ?

#

Payment Intents represent the state of all attempts to pay an invoice. I got this from doc

broken stirrup
#

let me know if you have specific questions