#tomrider_code
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/1356632414092394666
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
The supported button types/text are documented here: https://docs.stripe.com/elements/express-checkout-element#text
Note that even where similar options are supported on both, the actual type you need to specify may be different.
For example check-out vs checkout
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)
If the device is not logged into Google Pay, the button doesn't appear
Oh sorry and can you also specify paymentMethods: {googlePay: 'always'} when creating the element?
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'?
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
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
For Google pay in ECE?
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?
I can share with you via ngrok
here you go: https://joy-tom.ngrok.io/micky-and-mini/registry?pid=108253d1-c1b6-4484-a099-81e3345dc97f
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
I have this button as a logged in user
Yep same thing on your site at least. Thanks for the report
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
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
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
That flow would be explicitly against Apple Pay's TOS, and looks to likely be against GPay's, though you can double check with their support.
https://developer.apple.com/design/human-interface-guidelines/apple-pay/
https://developers.google.com/pay/api/web/guides/brand-guidelines
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' })} />
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