#olli-update-subscription

1 messages · Page 1 of 1 (latest)

sonic ermine
#

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.

heavy violet
#

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!

sonic ermine
#

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?

heavy violet
#

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?

sonic ermine
#

Sure thing! I'll be bouncing around to the other threads but will leave this one open.

heavy violet
#

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?

sonic ermine
#

Which request are you referring to when talking about the off_session parameter?

heavy violet
sonic ermine
#

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.

heavy violet
#

got it, thank you and have a nice evening :)

sonic ermine
#

Thank you, hope you do the same!