#eduardocorreal_unexpected

1 messages ¡ Page 1 of 1 (latest)

frigid pathBOT
#

👋 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/1303397173702033552

📝 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.

astral owl
#

Hello again! Thanks for confirming you use confirmPayment

we verify the payment intent, we get the status 'requires_action'
You mean that you retrieve the PI from the API?

#

When did you receive the cusomer back via redirect?

full tartan
#

i think the problem is that the user comes back to the redirect url before the payment intent changes to 'succeeded'

frigid pathBOT
full tartan
#

as we dont have webhooks, we retrieve the payment intent when the user access the redirect url and in that moment we get 'requires_action'

#

i guess if we wait for 2-5 seconds we will get the 'succeeded' status but is that how is it supposed to be?

#

we also have paypal enabled and it doesnt have this behavior

full tartan
#

so around 2 seconds before

grim yoke
#

Hello! I'm taking over and catching up...

#

This is expected behavior for Twint. Once your customer is redirected back to your URL there might be a small delay before the Payment Intent is updated with the outcome of the payment. The best option in these cases is, after your customer lands back on your site, poll the Payment Intent until the new status and details are updated. It should either be succeeded or, if the payment failed, requires_payment_method.

#

That said, investigating this revealed that this is not at all clear in our docs, and we're going to work to improve those.

full tartan
#

okay, for how much time do i need to poll?

#

around 10 seconds should be okay?

grim yoke
#

It should only take a few seconds at most. If I was building this integration I'd probably fetch once a second for around 5-10 seconds, yeah.

#

And display some kind of "processing your payment" message/loading indicator to the customer in the meantime.

full tartan
#

okay, for paypal should we also do polling just in case?

grim yoke
#

As far as I know PayPal doesn't have this same behavior, but implementing the polling just in case for all your redirect payment methods wouldn't hurt. If the first thing you do is check the Payment Intent's status when the customer lands back on your site and it's already updated (like PayPal) your polling code won't run because you already have the answer, but if for some reason it's not updated yet the polling code will run and you'll be safe regardless of the specific payment method.

full tartan
#

got it, thank you very much

#

that was helpful