#tarantino-47_unexpected
1 messages ยท Page 1 of 1 (latest)
๐ 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/1359893799614152976
๐ 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.
- tarantino-47_react-native-google-pay, 6 days ago, 95 messages
Hi, can you share the example confirmation request from when this happened? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Taking a look here
If you look at the PaymentIntent creation request, https://dashboard.stripe.com/logs/req_phWNoGGh3iVoyQ it looks like you've passed capture_method: "manual",
๐ stepping in here as pgskc needs to step away
If you look at https://dashboard.stripe.com/logs/req_45ljXAgDtebzqZ that is your frontend request to create the ConfirmationToken.
You can see that you did not pass captureMethod: 'manual' in the frontend so it defaults to automatic.
(It would be within the client_context hash of that request which shows your Elements options that you pass when initializing Elements)
So the mismatch leads to the error you are seeing.
I see
I do this before a user clicks submit
elements.update({
captureMethod: isManualCapture ? 'manual' : 'automatic',
});
do I need to pass captureMethod anywhere else?
so I do elements.update() and then elements.submit()
and then stripe.createConfirmationToken({ elements })
That flow seems fine to me.... do you know if this error is only happening when wallets are used?
it happens much frequently for google pay, yes
But you can't reproduce in test mode?
Ah wait wait I might know what is going on.
Yep okay
Unfortunately elements.update() is async here but does not return a promise.
We actually added the update-end Event to handle this: https://docs.stripe.com/js/element/events/on_update_end
I don't remember the particular reason elements.update() was not created async...
But you are running into a race condition here where elements.submit() is firing before the update ends.
So you are going to need to wait for that update-end Event before continuing here.
Whoops just realized I said elements.submit() is async when I meant to say elements.update() above. Edited it now.
