#tomrider_code

1 messages ยท Page 1 of 1 (latest)

solar ventureBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

nocturne pecan
solar ventureBOT
stark mantle
#

For example check-out vs checkout

nocturne pecan
#

I have selected the correct button type

shadow cove
#

Can you check your page from a device that isn't logged in to Google Pay to see if the correct message shows up? I know we show a that button when a saved card can't be found, looking into whether it is expected behavior for us to prefer to show the saved card number rather than the custom message(s)

nocturne pecan
#

If the device is not logged into Google Pay, the button doesn't appear

shadow cove
#

Oh sorry and can you also specify paymentMethods: {googlePay: 'always'} when creating the element?

nocturne pecan
#

Yep, now I get the correct label, but I have to be logged out from Google account and provide paymentMethods: {googlePay: 'always'}

#

Is there an option to have consistent results and always show 'Buy with GPay' and 'Buy with APay'?

shadow cove
#

Good question, unfortunately haven't found it documented whether this is expected behavior or not but it seems to be so from what else I can see. Checking into if this is configurable in some way

#

Not seeing anything for that. I will put in a feature request to note interest at least. I can definitely see why you'd want that behavior

nocturne pecan
#

I think it's wrong behaviour, because the buy button type should always show "Buy with" as is written in documentation

#

The type checkout always shows Checkout with regardless of whether the user is logged in or not

shadow cove
#

For Google pay in ECE?

nocturne pecan
#

Yes

#

The checkout type is respected in GPay regardless of device status

shadow cove
#

Interesting, I am not seeing that behavior on my test site. Checkout is still overridden by the saved card. Is your test site public in a way where I could see the google pay button on it quickly?

nocturne pecan
#

I can share with you via ngrok

shadow cove
#

I do see that there! That is interesting, not sure why my site is working differently. I will file all of this with the owning team

nocturne pecan
#

I have this button as a logged in user

shadow cove
#

Yep same thing on your site at least. Thanks for the report

nocturne pecan
#

I have one more question. Is there a way to not doing anything when user click the GPay button? I would like to redirect user to another page instead of displaying the GPay dialog

#

I've hacked this on my end by blocking click events from passing to child elements in the DIV, but I'm wondering if there's a way to do this natively in your library

shadow cove
#

There is the on click event, you can put custom logic in that, so code-wise you may be able to do a redirect. That said, I am not sure if there is a Google Pay or Stripe policy that that may be breaking. I'm not saying that there is, but there are sometimes guidelines around how these buttons can be used. Like one can imagine a scenario where a bad actor redirects to a google pay lookalike page to try to steal CC info. I will check with my colleagues to see if we know of anything like this
https://docs.stripe.com/js/elements_object/express_checkout_element_click_event

nocturne pecan
#

Yes, I used an onClick callback to redirect the user, but the payment dialog was automatically displayed for a short time anyway.

#

We would like to use the Pay with GPay or Pay with APay buttons to redirect user to our express checkout page without any payment operations

#

The real payment take place in our express checkout page

shadow cove
nocturne pecan
#

One more thing ๐Ÿ˜…

There is no way to programmatically close the payment dialog (e.g. in case of error). We have our own error handling, so we want close dialog in case of failure.

<ExpressCheckoutElement onConfirm={event => event.paymentFailed({ reason: 'fail' })} />
shadow cove
#

Yeah, not while the sheet is open unfortunately. A workaround that I have heard of is unmounting the express checkout element, but we don't have an official solution for that