#minh_api

1 messages ยท Page 1 of 1 (latest)

warm radishBOT
#

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

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

round gullBOT
robust plover
#

Hi there ๐Ÿ‘‹ I need substantially more context about your scenario. None of our test cards are capable of causing a second payment to automatically be processed. Creating a second payment is something that has to be done by your integration.

Do you have examples of these perceived duplicate payments that you can share?

spring patrol
#

ok, i will share confirmation image.

#

as you can see, I make one payment but the result, there are two payment(fail and success).

#

If I use these card(4000 0025 0000 3155 or 4242 4242 4242 4242), there are only one sucess payment.

robust plover
#

Can you copy/paste those object IDs here? Both the Payment Intent ID and the Charge IDs?

spring patrol
#

payment intent ID is : pi_3R27NSQnqvXcgBl91zVTrtZd
charge IDs are :
fail : ch_3R27NSQnqvXcgBl91FuzTszm
success: ch_3R27NSQnqvXcgBl91i6y9rba

#

this is fail payment detail picture:

#

and this is the success detail page:

#

Please help me.
In my opinion, it is appeared because of the test card 4000 0000 0000 3220.
That card need 3ds2 every time.
how do you think?
If that is not error, give me the explanation and confirmation url or docs.
If that is error, how can i fix error.
I want to your help.

robust plover
#

It looks like your code made two attempts to process this payment, which is why you see multiple Charges created.

First you attempted a payment from a server-side confirmation in this request:
https://dashboard.stripe.com/test/logs/req_z2k4lkjKgK7JMp
that failed because you set off_session to true, but the payment required authentication. This leads us to return an error since you indicated the Customer isn't on-session to complete the authentication challenge.

Then you made a second request to attempt the payment again, via a client-side confirmation:
https://dashboard.stripe.com/test/logs/req_loEPdYq1Vlv40W

#

And to clarify, that is the correct way to handle this flow if you're attempting off-session payments and they require customer authentication.

spring patrol
#

So you mean the test card 4000 0000 0000 3220 need the on_session?

robust plover
#

Not at all. Whether a payment is on or off-session is determined by whether the Customer is actively on your site when you attempt the payment, and is something you should tell us. It doesn't matter what card is being used.

spring patrol
#

My project's workflow is this:

  1. in user page, the user input the card info.
    in this, make the payment_method and check the 3ds2 authentication with setupIntent.
  2. in confirm page(next of the user page), user click the agree button.
    in this, make the payment with saved payment_method.

So I use the off_session method.
As a result, that fail and success payment is not error I think. Is it right?

robust plover
#

As a result, that fail and success payment is not error I think. Is it right?
I don't understand what you're trying to ask here, the phrasing isn't clear to me. But, let's take a step back.

Your customer is still on your site when the payment happens? If so, can you tell me more about why you're first using a Setup Intent to create the Payment Method and then a Payment Intent to process a payment?

You can accomplish all of that with just a Payment Intent, so I'm trying to better understand your situation to see if you need to do things this way, or if you can simplify your flow a bit.

spring patrol
#

sorry the workflow is suggested by the client, so I have to do like that.
Because of that reason, I save the payment_method with setup intent and then make the payment intent.

robust plover
#

That increases the number of API requests required to complete a single payment, and increases the chances that you may encounter rate limit issues.
https://docs.stripe.com/rate-limits

But in this case, the customer is still on your site when you're attempting the payment?

spring patrol
#

My project is reservation system and there are two types of reservation.
instance and request.
If the user make the instance reservation, the customer is still on my user site.
but if the user make the request reservation, the customer is not still on my user site.
so in the admin page, there is error, send the email to user. "please re-enter the card number".

#

However, I think I find the reason of the fail payment, so I am happy.
thank you very much.
in the future, if there is another question, I will contract you again.

robust plover
#

If the user make the instance reservation, the customer is still on my user site.
This would be an on-session payment, and off_session should be false in this case. Then, if a payment requires authentication, you get a Payment Intent in a requires_action state rather than an error.

but if the user make the request reservation, the customer is not still on my user site.
This is an off-session payment, and off_session should be set to true in this scenario.

#

Glad I could help!