#olli-update-subscription
1 messages · Page 1 of 1 (latest)
Hi 👋 please bear with me a moment while I dig up the functionality I have in mind to see if it's a fit here.
could be a stretch, but could passing the invoice's paymentintent to stripe.js's stripe.confirmCardPayment() function work? as stated:
When called, it will confirm the PaymentIntent with data you provide and carry out 3DS or other next actions if they are required.
i don't know if this would work though. i guess there's on way to find out!
I think you're looking for the pending_if_incomplete behavior. You're trying to stage a subscription update, but roll it back if the payment for that fails, right?
If so, I think this is the guide that you're looking for:
https://stripe.com/docs/billing/subscriptions/pending-updates
yep, that's what i'd like to do. i'll take a look, thanks
i am trying the idea i stated above though, would you mind keeping the thread open for ~5min in case i run into some errors i can't find a way around?
Sure thing! I'll be bouncing around to the other threads but will leave this one open.
bingo, it worked
i expanded the subscription's latest_invoice.payment_intent, sent the client secret to the client, then called stripe.confirmCardPayment(). 3ds works like expected, the subscription is updated and the correct webhook events are dispatched
i'm assuming i can probably figure out how to handle generic card failures using the paymentintent's status too, and rollback subscription changes that can't be made. thanks :D
oh and btw, should i set off_session=false when doing this, or may that cause unexpected consequences?
Which request are you referring to when talking about the off_session parameter?
posting to /v1/subscriptions/:id
Ah gotcha, no I would not recommend adjusting that, as it will change the default value for the Subscription, and could impact future renewal payments.
got it, thank you and have a nice evening :)
Thank you, hope you do the same!