#dominikganic_best-practices

1 messages ยท Page 1 of 1 (latest)

solemn perchBOT
#

๐Ÿ‘‹ 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/1349091321289117818

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

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

unkempt badger
#

I have this code in my backend to Pay():

     'off_session' => false,
     'expand' => ['payment_intent.payment_method']
]);```
#

Error creating Payment Intent for invoice: This invoice can no longer be paid. Consider voiding, marking as uncollectible, or marking as paid out of band instead.

#

That's the error I get when paying it. :/ But it's still "open". The status of the payment intent in my stripe dashboard is "canceled".

manic edge
#

Hello
Can you share the subscription as well as invoice ID you're working with?

unkempt badger
#

Hi, yes sure, sec

#

Invoice ID: in_1R1WrKLZihhBkt1cXWNeBVWw
Subscription ID: sub_1R1OVVLZihhBkt1czf93LP2N

#

The subscription is set to "past_due"
The latest invoice is status "open" but in my stripe dashboard I see "failed" (red) - thats confusing

#

tl;dr; my question is: What should I do now at best to pay this subscription invoice? ๐Ÿ™‚

manic edge
#

Hmm have you tried paying the invoice via the payment page?

#

I'm still seeing invoice as open

#

If that doesn't work, try moving the test clock a day forward and see if the invoice gets updated

unkempt badger
#

That's what I see with red (failed in english)

#

It tells me "The attempt to charge the customer's stored payment method has failed once. No further retry attempts are scheduled. Please check your retry settings."

#

I will move forward the test clock now ๐Ÿ™‚

#

Invoice is already 9 days old and nothing has happened yet.

#

Whenever I try to pay it via API (invoices->pay) I receive:
"This invoice can no longer be paid. Consider voiding, marking as uncollectible, or marking as paid out of band instead."

manic edge
unkempt badger
#

req_Mt3C05SOslaXhQ

#

You need this? ๐Ÿ™‚

manic edge
#

Yup, thanks.. Looking

unkempt badger
#

Should I mark this invoice as "void" or whatever matches here and create a new invoice - bound to the subscription (if possible) - and let the user pay it?

I had at least 10 attempts paying it when it suddenly "canceled" the invoice's paymentintent

manic edge
#

Yeah I believe that's the issue here. A PaymentIntent can only be attempted upto 10 times. After that point it is cancelled automatically. Cancelled PaymentIntent causes the invoice to get stuck in this weird state.

unkempt badger
#

Ah yes. That's what I want to hear xD

#

Makes sense then. But how should I proceed? The customer should be able to pay the invoice and keep his subscription alive active ๐Ÿ™‚

manic edge
#

I don't exactly know what happens to the subscription in this case since subscription status is determined by the latest invoice state.

You could mark the current invoice as void or paid out of band &

then create a one-off invoice using create Invoice API endpoint - https://docs.stripe.com/api/invoices/create#create_invoice-subscription

unkempt badger
#

Yeah, I've setup a behavior in the Stripe Dashboard, once a subscription is in the state of "past_due" it will convert in 7 days to "unpaid" and then within 14 days to "canceled".

That's why I'd like to proceed here ๐Ÿ™‚ Thanks for your solution, I will implement it that way and I think, when I manually void the invoice and create a new one, it should work!

Thanks ๐Ÿ™‚ Have a nice day.