Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Question] How to enable Google/Apple Pay to be invoked from a WebView? #15384

Open
michaldivis opened this issue May 23, 2022 · 1 comment
Open
Labels
s/unverified New report that has yet to be verified t/bug 🐛

Comments

@michaldivis
Copy link

michaldivis commented May 23, 2022

Hi, this is more of a question that a bug report.

Is there a way to enable Google/Apple Pay to be invoked from a WebView? I'm using a payment service (similar to Stripe) that will gives me a payment URL. To finish a payment, I have to open a browser, navigate to that URL and let the user pay.

I'm using a WebView because I need to be able to intercept the browser navigation and close it when it's navigating to the return URL I've provided to the payment service. That's why I'm not opening the URL in a browser intent.

The problem is that when opened in a WebView, clicking on the Google Pay button fails to open the Google Pay overlay (where you can pick a card and pay) and the payment cannot be finished. I suspect that the WebView isn't able to invoke the Google Pay API, is there a way to enable that? If not, I'd have to switch to opening the payment URL in a browser intent (using the Xamarin.Essentials's Browser API) and I'd lose the option to intercept the browser navigation.

Thanks for any advice!

EDIT:

I've received advice from the my payment processor in the meantime. They said:

Use the Chrome Custom Tabs for Android instead of the WebView. It works similarly but also supports standard functionality (such as Google Pay). To use Apple Pay on iOS, use the SFSafariController.

I'll try that and report back here.

@michaldivis michaldivis added s/unverified New report that has yet to be verified t/bug 🐛 labels May 23, 2022
@JDurazzi
Copy link

JDurazzi commented Oct 23, 2023

Hi @michaldivis , I came to your problem today. Do you manage to resolve the problem with Chrome Custom Tabs and SFSafariController? Can you post an example maybe?
Thank you in advance,
Jacopo

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

2 participants