#ameotoko_code

1 messages ยท Page 1 of 1 (latest)

flat dawnBOT
#

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

๐Ÿ“ 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.

devout dust
#

๐Ÿ‘‹ happy to help

#

would you mind sharing more information (e.g. request ID)?
if it's a 400 error this means that your code is sending an invalid request, and means that you need to fix your code

trail vigil
#

But I am not constructing that request, it's a legitimate call of stripe.confirmPayment()

#

hang on, I'll give you the details

devout dust
trail vigil
#

req_Ugvtn7cYwWJvBd

#

Theoretically, a user can open the payment page and get distracted. If he comes back a day later and submits the form โ€“ the incomplete subscription is already expired, which leads to the error above.

devout dust
#

hmmm I see

#

what are you exactly seeing in the frontend as an error?

trail vigil
#

I'm fine with the error itself. What's unexpected is that stripe fails instead of returning the error, as described in docs.

trail vigil
devout dust
#

in the dev tools console

trail vigil
devout dust
#

give me a few minutes to replicate

trail vigil
#

Sure, thanks for taking a look

devout dust
#

I actually can't reproduce the behavior you're describing

trail vigil
#

hm

#

can you suggest what I might be doing wrong?

devout dust
#

the error is returned properly and as you can see in the screenshot I can inspect it normally

unreal wind
#

hi! I'm taking over this thread. let me know if you have any other question.

trail vigil
unreal wind
trail vigil
#

Yes, but technically it exists in incomplete_expired state. This would be the same if it just expired after 23h, correct?

unreal wind
#

so you can no longer use the PaymentIntent from that Subscription

#

you would need to create a new one

trail vigil
trail vigil
#

As I already mentioned โ€“ I do understand the error, the error is not the problem. The problem is โ€“ instead of being returned from stripe.confirmPayment() as described in the guide, the call itself fails with 400 Bad request, which breaks execution of the script and makes further handling in the frontend impossible.

unreal wind
trail vigil
#

Yes. That's why I think I need to test it with the sample now, which brings me to my last question

trail vigil
unreal wind
#

I'm sorry I'd like to help but I don't get your question. why do you need a Simple sample? what exactly are you trying to reproduce? what's the issue you are trying to solve?

trail vigil
#

Sorry if I'm being unclear

unreal wind
#

can you try re-explaning your question?

trail vigil
#

It reads:

If the confirmation fails, the Promise will resolve with an {error} object that describes the failure.

#

My problem is, that I get this instead

#

This cannot be handled by the application, and that is the problem

unreal wind
#

got it. and why do you need a Stripe sample for this?

trail vigil
#

I don't, if you can tell me what I'm doing wrong, or how can I handle this in a best possible way

unreal wind
#

got it. give me a few minutes to try to reproduce this on my end.

trail vigil
#

Sorry, I finally found the bug on my end, it was tiny and very easy to miss

unreal wind
#

oh, great! so is your issue resolved?

trail vigil
#

Yes. Thank you for your patience! I was starting to think I found a bug in Stripe library, which is not likely tbh ๐Ÿ˜…

#

For anyone else searching: stripe.confirmPayment() returns a Promise, so make sure to use await if you don't want to chain .then(). Somehow I lost await while refactoring and didn't notice.