#nicolaswemin_unexpected

1 messages ยท Page 1 of 1 (latest)

past geyserBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1222531470464385097

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

unique frostBOT
fringe iron
#

Can you share the invoice ID?
What's the status of the invoice after 3 attempts?

indigo fractal
#

@fringe iron Hello ๐Ÿ™‚

#

Absolutely, here it is: in_1OyvHNCkc1cy5pgJpTl1jZ8P

#

It's status=open, weirdly enough

#

Here's a snipper to repro

fringe iron
#

It looks like the underlying payment intent was cancelled

indigo fractal
#
  try {
    const result = await stripe.invoices.pay('in_1OyvHNCkc1cy5pgJpTl1jZ8P')

    console.log(result)
  } catch (err) {
    console.log(err)
  }
#

Yes, I'm simulating the customer attaching different payment methods and failing those

#

Until he finds a card that works

fringe iron
#

The PaymentIntent has a set number of confirmation attempts that you can make for security reasons

indigo fractal
#

aham...

fringe iron
#

I believe the one associated with the invoice exhausted that limit

#

Hence, the PaymentIntent was cancelled

indigo fractal
#

Is there any way to restart it in a way?

#

I mean, what happens to the Subscription that this Invoice is for? How can I collect payment and get the Subscription set back to activeagain

fringe iron
#

Subscription is still in past_due status, yeah? You can consider voiding, marking as uncollectible, or marking as paid out of band

#

Subscription status is associated with the most recent invoice afaik

indigo fractal
#

but that doesn't collect payment

fringe iron
#

There's no way to collect the payment for that specific invoice on Stripe given it exhausted the confirmation limit.

indigo fractal
#

oh wow, that's interesting

fringe iron
#

Let me check something really quick though

indigo fractal
#

so the customer pretty much locked himself out of the subscription?

#

If he can't pay that invoice, then his subscription is stuck at past_due

#

voiding it or collecting out of band isn't an option since the customer needs to actually pay us ๐Ÿ™‚

#

of course, take your time!

fringe iron
#

What happens if you call /pay endpoint and try to pay the invoice? OR could you try paying the invoice from the dashboard?

indigo fractal
#

Code-wise it throws that error

#

Here's a very simple snippet

fringe iron
#

Ah yup just saw the error

indigo fractal
#

try {
const result = await stripe.invoices.pay('in_1OyvHNCkc1cy5pgJpTl1jZ8P')

console.log(result)

} catch (err) {
console.log(err)
}

fringe iron
#

So I checked with a colleague about this.. Unfortunately, this specific invoice can't be paid.

What you can do instead is create a separate PaymentIntent for one-time payment, collect new PaymentMethod from the customer and accept payment that way. Once you do that, you can mark the invoice paid out of band.

You can also set the collected payment method as customer's default

indigo fractal
#

Aham...

#

I see..

#

Thanks a lot, much appreciated.

fringe iron
#

NP! We'll make sure to flag this to our product team as there has to be a better way to handle this usecase

indigo fractal
#

Thank you hanzo, sounds about right