I am working on android application. The server on which I am working gives the subscription feature to the users, so users need to do payment to become a member on the website.
我正在研究android应用程序。我正在使用的服务器为用户提供订阅功能,因此用户需要付款才能成为网站上的会员。
Now I am working on the same in android app and using webview to perform the payment gateways. I am loading the url of stripe checkout payment in the webview.
现在我在Android应用程序中使用相同的工具并使用webview来执行支付网关。我正在webview中加载条带结账付款的网址。
But I am getting the below error for Stripe checkout in webview.
但是我在webview中收到Stripe checkout的以下错误。
Sorry, there was a problem loading Checkout. If this persists, please try a different browser.
抱歉,加载Checkout时出现问题。如果仍然存在,请尝试使用其他浏览器。
How can I resolve this issue in the webview, so that it can work in my application.
如何在Webview中解决此问题,以便它可以在我的应用程序中工作。
Please help if anyone know about this, this would be a great help.
请帮助,如果有人知道这一点,这将是一个很大的帮助。
Thanks a lot in advanced.
非常感谢先进。
3 个解决方案
#1
5
Stripe checkout indeed does not work on Android WebViews, but it does work on iOS UIWebView... So... UserAgent comes to rescue!
Stripe checkout确实不能在Android WebViews上运行,但它确实可以在iOS UIWebView上运行......所以... UserAgent来救援!
webView.getSettings().setUserAgentString("Mozilla/5.0 (iPhone; CPU iPhone OS 9_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13E233 Safari/601.1");
#2
0
Unfortunately, Stripe Checkout doesn't support displaying Checkout in webviews. The best solution is to build your own payment form using Stripe.js.
很遗憾,Stripe Checkout不支持在网络视图中显示Checkout。最好的解决方案是使用Stripe.js构建自己的付款表单。
#3
0
I have added this to the userAgent of the webview and it worked."Mozilla/5.0 (Linux; Android 4.4.4; One Build/KTU84L.H4) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/28.0.0.20.16;]"
我已将此添加到webview的userAgent并且它有效。 “Mozilla / 5.0(Linux; Android 4.4.4; One Build / KTU84L.H4)AppleWebKit / 537.36(KHTML,类似Gecko)版本/ 4.0 Chrome / 33.0.0.0 Mobile Safari / 537.36 [FB_IAB / FB4A; FBAV / 28.0.0.20 0.16;]”
#1
5
Stripe checkout indeed does not work on Android WebViews, but it does work on iOS UIWebView... So... UserAgent comes to rescue!
Stripe checkout确实不能在Android WebViews上运行,但它确实可以在iOS UIWebView上运行......所以... UserAgent来救援!
webView.getSettings().setUserAgentString("Mozilla/5.0 (iPhone; CPU iPhone OS 9_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13E233 Safari/601.1");
#2
0
Unfortunately, Stripe Checkout doesn't support displaying Checkout in webviews. The best solution is to build your own payment form using Stripe.js.
很遗憾,Stripe Checkout不支持在网络视图中显示Checkout。最好的解决方案是使用Stripe.js构建自己的付款表单。
#3
0
I have added this to the userAgent of the webview and it worked."Mozilla/5.0 (Linux; Android 4.4.4; One Build/KTU84L.H4) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/28.0.0.20.16;]"
我已将此添加到webview的userAgent并且它有效。 “Mozilla / 5.0(Linux; Android 4.4.4; One Build / KTU84L.H4)AppleWebKit / 537.36(KHTML,类似Gecko)版本/ 4.0 Chrome / 33.0.0.0 Mobile Safari / 537.36 [FB_IAB / FB4A; FBAV / 28.0.0.20 0.16;]”