#tarantino-47_error
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/1232311416162095145
๐ 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_code, 2 hours ago, 15 messages
- tarantino-47_api, 6 days ago, 26 messages
hi there!
can you share a screenshot of the error? or even better a link where I can reproduce the issue?
can you share a PaymentIntent ID (pi_xxx) with this issue?
it happens during elements.submit();
are you using the deferred intent flow, where you create the PaymentIntent later in the flow?
correct
why can't you share the URL so I can view the error myslef?
currency: 'usd',
loader: 'always',
mode: 'payment',
paymentMethodTypes: ['card'],
amount: displayedTotalPrice * 100,
paymentMethodCreation: 'manual',
because localhost is under VPN
wait a minute
pls let me know once you open it - I will delete it from this chat
^
@subtle epoch
thanks for sharing the link! Discord is busy, so give me a few minutes.
ok, I'm deleting the link above. let me know if you need it later
hope this thread won't close automatically
thank you
I'm getting a lot of logs and errors in console but not able to reproduce that error that you are seeing. It seems like something is in a constant re-render? I can't even open the Google Pay modal?
Just getting continuous logs
Do you see the same happen when you load the page?
are you able to see this ?
Yes
But when I click submit nothing happens
Don't get that error you screenshotted
Yeah I did that... but let me hard refresh and try again. One sec
Yeah don't know what to tell you. I'm just getting a continuous log for isPlatformPay: true and when I click submit, nothing happens.
Can you show me your client-side code here?
No, I literally get spammed with errors/logs in console
And tons of repetitive network requests being triggered to recaptcha and a CSS styles sheet. Things that indicate a constant re-render occuring
The only failed network requests are a 404 to https://poetic-direct-colt.ngrok-free.app/undefined
hm
This is what my Console looks like:
So at this point let's pause on the repro from my side, and if you can share you client-side code that would be a start here
sure
Is this error thrown when you try to complete the Google Pay modal?
Or when it is attempting to be displayed?
when it is attempting to be displayed
trying to create a video recording for you
Yeah a video isn't that helpful, really I need to see your code
For instance you are calling elements.update({}) in a useEffect here
Instead, have you tried just setting your options at that point and then rendering Elements?
not sure if I already mentioned, only GPay doesnt work, credit cards work as expected
check the first error
Ah okay yeah I know what that is.
So you are doing something within your confirm handler right now before calling elements.Submit()
Like calling your backend?
yep
Basically Apple/Google have security precautions in place where they require the modal to be presented based on an actual user click/gesture -- if the modal isn't presented within a very short time period of the confirmHandler being called then it triggers an error due to this security limitation
I fetch payment details before elements.Submit()
So basically you have to refactor to move those async actions to sometime prior in your flow prior to your confirm handler function
We don't have any control of this from our side... so really that is the only way forward here
If you would like, you can test it out by just commenting out that async process and testing again and you should see it work fine
but credit cards work as expected, this is only related to GPay?
can I do buttonRef.current.click(); before elements.Submit() ?
like programatically click on confirm button
I've not tried that but I have a feeling it won't work -- elements.submit() is what actually triggers the modal to be presented
That is what the security limitation is based off of
the thing is I need to create an account first, then charge the customer
Oh yeah that's fine. Just move that code to after elements.submit()
You don't actually charge until you confirm the PaymentIntent
true
When elements.submit() resolves that just creates the PaymentMethod, it doesn't charge the Customer
How's it going @untold spindle ?