#Harry_QuickReply
1 messages · Page 1 of 1 (latest)
How do we let user complete additional setup in subscription update?
You enable this setting: https://dashboard.stripe.com/settings/billing/automatic
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Otherwise, you'll need to bring your user back on-session in order for them to confirm the payment and provide 3DS/auth
We do not want to update the subscription, unless we receive the payment.
Sure, that's whatpayment_behavior: 'pending_if_incomplete'does
user is on-session while performing update. but the above code we have run on server, does running on browser will bring it on session?
Yes, they'll need to be client side to perform the required 3DS
ok. so no need to manually render iframe etc, apart from calling it on client side?
and on the security side, how do we run it securely on client without passing secret key
You can either:
- Initialise Elements and confirm the
pi_xxxsecret in your website. - Send your user the the hosted invoice page.
You'd use Stripe.js with your publishable key just like you'd confirm any other payment: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment
No. What do you need to update on the subscription?
suppose a customer wants to upgrade to higher plan. that is our use case
we want customer to be able to upgrade successfully. and if for that 3D authentication is needed, that should be taken as well
But you've already performed the subscription update call (as shown in your original message). Payment failed, so now you need the customer to perform 3DS and confirm the payment, no?
Then continue to do that. If/when payment fails, you need to inform your customer (listen for invoice.payment_failed events), bring them back on-session and confirm the Payment Intent on the invoice generated by the subscription update – that can be done client-side with Stripe.js and your publishable key
Sorry, invoice.payment_action_required events: https://stripe.com/docs/billing/subscriptions/overview#requires-action
ok thanks a lot this looks very helpful