#tarantino-47_error

1 messages ยท Page 1 of 1 (latest)

muted boughBOT
#

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

flat sunBOT
#

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.

subtle epoch
#

hi there!

untold spindle
#

google pay option is visible and clickable

#

hello

subtle epoch
#

can you share a screenshot of the error? or even better a link where I can reproduce the issue?

untold spindle
#

can't provide you with the link, sorry

subtle epoch
#

can you share a PaymentIntent ID (pi_xxx) with this issue?

untold spindle
#

it happens during elements.submit();

subtle epoch
#

are you using the deferred intent flow, where you create the PaymentIntent later in the flow?

untold spindle
#

correct

subtle epoch
#

why can't you share the URL so I can view the error myslef?

untold spindle
#
  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

subtle epoch
#

thanks for sharing the link! Discord is busy, so give me a few minutes.

untold spindle
#

ok, I'm deleting the link above. let me know if you need it later

flat sunBOT
untold spindle
#

hope this thread won't close automatically

twilit iris
#

๐Ÿ‘‹

#

Sorry for the delay, taking a look

untold spindle
#

thank you

twilit iris
#

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?

untold spindle
#

are you able to see this ?

twilit iris
#

Yes

#

But when I click submit nothing happens

#

Don't get that error you screenshotted

untold spindle
#

you need to fill out all the details

#

name, email address etc

#

then click submit

twilit iris
#

Yeah I did that... but let me hard refresh and try again. One sec

untold spindle
#

please do

#

just fyi, Google Pay modal doesnt get opened for me as well

twilit iris
#

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?

untold spindle
#

check networks tab

#

do you have any failed requests?

twilit iris
#

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

untold spindle
#

hm

twilit iris
#

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

untold spindle
#

sure

twilit iris
#

Is this error thrown when you try to complete the Google Pay modal?

#

Or when it is attempting to be displayed?

untold spindle
#

when it is attempting to be displayed

#

trying to create a video recording for you

twilit iris
#

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?

untold spindle
#

not sure if I already mentioned, only GPay doesnt work, credit cards work as expected

#

check the first error

twilit iris
#

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?

untold spindle
#

yep

twilit iris
#

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

untold spindle
#

I fetch payment details before elements.Submit()

twilit iris
#

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

untold spindle
#

but credit cards work as expected, this is only related to GPay?

twilit iris
#

Yes

#

This is specific to Google Pay and Apple Pay

untold spindle
#

can I do buttonRef.current.click(); before elements.Submit() ?

#

like programatically click on confirm button

twilit iris
#

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

untold spindle
#

the thing is I need to create an account first, then charge the customer

twilit iris
#

Oh yeah that's fine. Just move that code to after elements.submit()

#

You don't actually charge until you confirm the PaymentIntent

untold spindle
#

true

twilit iris
#

When elements.submit() resolves that just creates the PaymentMethod, it doesn't charge the Customer

untold spindle
#

I see

#

let me try

#

just keeping this thread opened

twilit iris
#

How's it going @untold spindle ?