#PyroFiire

1 messages ยท Page 1 of 1 (latest)

neon geyserBOT
nocturne acorn
#

Hello ๐Ÿ‘‹
Can you provide more information about your usecase? What exactly are you updating when the customer arrives on the payment page?

next scarab
#

I update this shopping cart, it can contain products (PaymentIntent) or a subscription or a subscription and purchases (I use the "add_invoice_items" key to add additional purchases). It often happens that the customer leaves the payment page to return later. In the case of a PaymentIntent, I update the items and the total with the shopping cart in session. But for subscriptions this isn't possible, so I create a new one. I was wondering if this was a problem.

nocturne acorn
#

I believe the deferred PaymentIntent/subscription creation flow can help with this
https://stripe.com/docs/payments/accept-a-payment-deferred

You'd create the PaymentIntent/Subscription once the customer confirms that they want to checkout. The above flow allows you to render PaymentElement without having an Intent attached.

#

Have you looked into that already?

#

lmk if that helps or if you have follow ups @next scarab

next scarab
#

Ok I see how to do it thanks

nocturne acorn
#

Awesome! Glad I could help ๐Ÿ™‚

next scarab
#

Can I ask you another question about subscriptions?

nocturne acorn
#

Sure

next scarab
#

I did some tests and was able to create a 1-month subscription, then another 3-month subscription for the same product. This creates two subscriptions in Stripe.
Should I check whether the user already has an active subscription in Stripe and tell them to update their subscription, rather than having them check out again and create a new subscription? Are there any other solutions?

#

So I think I should block the checkout on my site if the customer already has an active subscription that corresponds to a product in the cart. Correct?

nocturne acorn
#

Should I check whether the user already has an active subscription in Stripe and tell them to update their subscription, rather than having them check out again and create a new subscription? Are there any other solutions?

So I think I should block the checkout on my site if the customer already has an active subscription that corresponds to a product in the cart. Correct?
Correct. You'd need to track this yourself and prevent users from creating duplicate subscriptions