#mrrobot_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/1460546030377504913
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
👋 Hi there! Let me take a look
It looks like on mobile devices, Google Pay might not be available for Checkout Sessions when loaded inside a webview, unless using Chrome Custom Tabs
But what is strange is why this test page can render Google Pay in the webview? https://docs.stripe.com/testing/wallets
Yes, I see that as well. But I believe that's not using Checkout Sessions. I'm trying to double-check this behaviour…
It seems that Chrome Custom Tabs may be required for this. Or if you can follow these requirements, so that the Payment Request API is available: https://developers.google.com/pay/api/android/guides/recipes/using-android-webview
I have already made the modifications mentioned here, and according to my tests, if I don't make these changes, I found that even this test page (https://docs.stripe.com/testing/wallets) cannot render Google Pay.
Alright. Can you share a Checkout Session ID (cs_test_…) which you load in a WebView, but do not see Google Play?
Okay, please wait a moment.
cs_test_a1QzxhP2VhHLa8VGERgrGOa13JtNErtqZtCT0KhRVzk3LxWjbWUA240ACi
hi! I'm taking over this thread.
My understanding is that there are only two ways to get Google Pay to work in a webview:
- Use Chrome Custom Tabs
- Or follow all requirements here: https://developers.google.com/pay/api/android/guides/recipes/using-android-webview
I have followed all the requirements here, https://developers.google.com/pay/api/android/guides/recipes/using-android-webview (except for publishing your integration, which should not affect), so the test page can be rendered properly (https://docs.stripe.com/testing/wallets).
I just double checked with a colleague, and looks like Google Pay is just not supported when using the PaymentElement in a webview. so what you see is expected.
Alright, is Chrome Custom Tabs definitely a feasible solution?
And can you tell me the reason why the test page can properly render Google Pay in a webview?
the test page is not using Checkout Session + Payment Element, that's why you can see Google Pay.
Can I use the same integration method as this test page to achieve the integration of Google Pay, or can I only use Chrome Custom Tabs?
if you use Payment Intent + Payment Element, then Google Pay should work in a webview, assuming you follow all requirements listed in the link I shared above.
you can learn more about this here: https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements