1.html中的head标签下添加如下三行配置
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style> .stripe_checkout_app { height: 580px !important; } </style>
2.在html的里面链接上stripe支付支持的js
<script src="https://checkout.stripe.com/checkout.js" async=true></script>
其中async=true表示此js是异步加载的不阻塞页面渲染加载,是否添加此设置看使用的具体情况
3.android中使用的话webview需要添加如下设置
//允许执行js代码
WebView.getSettings().setJavaScriptEnabled(true);
//设置webview的userAgent,防止在一些手机系统比较低或者chrome版本比较低的情况下,stripe判定不支持此浏览器版本而导致的调起stripe失败跳转到stripe报错页面的问题
WebView.getSettings().setUserAgentString("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");
4.当然android的话别忘记添加网络权限
<uses-permission android:name="android.permission.INTERNET" />