stripe / stripe-js

Loading wrapper for Stripe.js
https://stripe.com/docs/js
MIT License
633 stars 156 forks source link

[BUG]: Google pay is not recognized in in-app browser (android) #618

Closed karen1au closed 5 months ago

karen1au commented 5 months ago

What happened?

When the web app is opened in the in-app browser of a Capacitor app, canMakePayment returns false for google pay, while opening the web app directly in the phone's chrome browser works. The only difference I could find in related stripe requests is that the request_surface in form data sent in the in-app broser is web_split_card_element_popup, and the one made directly in chrome is web_elements_controller.

Chrome: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36 In-app browser: Mozilla/5.0 (Linux; Android 13; sdk_gphone64_arm64 Build/TE1A.220922.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/124.0.6367.179 Mobile Safari/537.36

Environment

Mozilla/5.0 (Linux; Android 13; sdk_gphone64_arm64 Build/TE1A.220922.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/124.0.6367.179 Mobile Safari/537.36

Reproduction

No response

brendanm-stripe commented 5 months ago

Unfortunately in-app browsers & webviews like this can has limitations on browser API like payment requests, or prevent pop-ups etc, so not all features will work as they do in supported browsers. At this time, the only official cross-platform SDK we maintain is our React Native SDK.

You might want to look at something like this community maintained plugin to enable some of these flows: https://stripe.capacitorjs.jp/