#hexiaolong

1 messages · Page 1 of 1 (latest)

tawdry gladeBOT
alpine sage
#

Hi there!

#

How are you integrating with Stripe? PaymentIntent + Payment Element, or something else?

red rock
#

import { PaymentElement, useStripe, useElements } from '@stripe/react-stripe-js'

#

After clicking on the payment, I will listen for whether there is a parameter named "payment_intent_client_secret" in the URL.

alpine sage
#

I managed to reproduce what you described. Give me a few minutes to investiguate.

red rock
#

okay, thank you so much

alpine sage
#

So it looks like this is expected. One way to avoid this is to set redirect: if_required when confirming the PaymentIntent.

red rock
#

like this?

alpine sage
#

Yes, have you tried?

red rock
#

If I configure this, what changes do I need to make? I found that there are errors in receiving the results as before.

alpine sage
#

I found that there are errors in receiving the results as before.
What do you mean? What exact errors do you see and when?

red rock
#

I have tried it, and it is indeed possible to close the payment pop-up window directly. However, I am not able to detect the return of the payment result.

red rock
alpine sage
red rock
#

okay,I have two questions. The first one is that when selecting "if_required" as the redirect mode, it is necessary to confirm whether the payment was successful through the asynchronous result of stripe.confirmPayment({}), because there will never be another redirection. The second question is about the description in the documentation that says "If you set redirect: "if_required", then stripe.confirmPayment will only redirect if your user chooses a redirect-based payment method." I don't understand how users can choose whether to redirect or not in this case.

alpine sage
#

because there will never be another redirection.
Correct
I don't understand how users can choose whether to redirect or not in this case.
It's not the user who choose. It depends on the PaymentMethod used. For example some bank payment methods require that we do a redirect.

red rock
#

Ok, I will try to understand and consult you if I have any questions. Thank you very much