#jean-baptiste-r_unexpected

1 messages ยท Page 1 of 1 (latest)

candid elmBOT
#

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

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

errant nebula
#

Hello ๐Ÿ‘‹
Lemme explain our implementation to be sure you have all informations:

lusty moonBOT
errant nebula
#

Here is how we work:
When someone books something, (i.e. when he has given his payment informations) the front app requests the back app. The back application creates the booking in database (with "WAITING" state), then the payment intent from Stripe and send the information of the payment intent (like client secret code) to the front application.
Then the front application uses these information to send payment method and confirm the payment to Stripe(*).
Last, Stripe uses our webhook to tell us if the payment has succeeded or not. (And so the webhook changes the booking in our database to "PAID" or "NOT PAID")

I think it's a common implementation, but maybe it's important to tell you so if we did an error, then you know. I can do a little plan if it can help, just ask. ๐Ÿ™‚

My problem: When a user uses a test card, the front application will send the test card to stripe (step with *) but Stripe will answer with a 402 error and will send nothing so our webhook.

Thank you for your time ๐Ÿ™

kindred pendant
#

You can't use test cards in live mode

#

Can you share the request id where you get a 402?

errant nebula
#

Not sure of which Id you're requesting x:
This one ? : pi_3P1nBICN7b44IDnX0UIozKic
That's the payment intent I created with a test card in production environnement

kindred pendant
#

Why are you using test cards in production?

#

That's completely expected that that won't work

errant nebula
#

Because a user tried to use one, and we wan't to not take in account a booking when a test card has been used

#

That's why I expected Stripe to send a request to our webhook in this case

kindred pendant
#

Ah no

#

We just can see it's a test card and immediately return a 402

#

Payment processing isn't even attempted

#

So no need to notify you of anything

#

Payment Intent is still in a requires_payment_method state

errant nebula
#

So I need to ask the user to give us a new card and send the same request with new information ?

kindred pendant
#

Well they can't pay in live mode with a test card

#

If they need to book, they need to use a real card so we can actually receive payment

#

But the fact that they used a stripe test card tells me they probably aren't a serious customer

#

Kinda suspicious

errant nebula
#

True

#

I think we will simplify the problem by requesting a cancel to the back application if the request to stripe fails