在 WebView 中无限处理付款
Payment processing infinitely in WebView
我有一个测试网站,其中 PayUMoney 支付处理在测试模式下运行完美。
我在 webview
中使用了相同的 url
并且还启用了 javascript
,但付款正在无限处理(永远加载)。
请帮我解决这个问题。谢谢!
public class MainActivity extends AppCompatActivity {
private WebView webview;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
webview =(WebView)findViewById(R.id.webView);
webview.setWebViewClient(new WebViewClient());
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setDomStorageEnabled(true);
webview.setOverScrollMode(WebView.OVER_SCROLL_NEVER);
webview.loadUrl("https://gatewaypayment.000webhostapp.com");
}
@Override
// This method is used to detect back button
public void onBackPressed() {
if(webview.canGoBack()) {
webview.goBack();
} else {
// Let the system handle the back button
super.onBackPressed();
}
}
}
我也遇到过类似的情况,后来终于弄清楚加载时间长的原因是测试详情更新频繁,或者是PayUMoney自己提供的测试环境宕机了。还要确保以下内容:
要在测试模式下测试 Bolt Checkout,您需要更改使用的 JavaScript 库,并使用测试模式密钥和盐生成哈希。
因此,在测试模式下集成时,请在付款请求页面的 head
部分中包含如下所示的脚本。
<script id="bolt" src="https://sboxcheckout-static.citruspay.com/bolt/run/bolt.min.js" bolt-
color="<color-code>"
bolt-logo="<image path>">
</script>
在沙箱上完成并测试集成后,将沙箱 JavaScript 库替换为 PayU 提供的生产库。
<script id="bolt" src="https://checkout-static.citruspay.com/bolt/run/bolt.min.js" bolt-color="<color-
code>"
bolt-logo="<image path>">
</script>
我有一个测试网站,其中 PayUMoney 支付处理在测试模式下运行完美。
我在 webview
中使用了相同的 url
并且还启用了 javascript
,但付款正在无限处理(永远加载)。
请帮我解决这个问题。谢谢!
public class MainActivity extends AppCompatActivity {
private WebView webview;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
webview =(WebView)findViewById(R.id.webView);
webview.setWebViewClient(new WebViewClient());
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setDomStorageEnabled(true);
webview.setOverScrollMode(WebView.OVER_SCROLL_NEVER);
webview.loadUrl("https://gatewaypayment.000webhostapp.com");
}
@Override
// This method is used to detect back button
public void onBackPressed() {
if(webview.canGoBack()) {
webview.goBack();
} else {
// Let the system handle the back button
super.onBackPressed();
}
}
}
我也遇到过类似的情况,后来终于弄清楚加载时间长的原因是测试详情更新频繁,或者是PayUMoney自己提供的测试环境宕机了。还要确保以下内容:
要在测试模式下测试 Bolt Checkout,您需要更改使用的 JavaScript 库,并使用测试模式密钥和盐生成哈希。
因此,在测试模式下集成时,请在付款请求页面的 head
部分中包含如下所示的脚本。
<script id="bolt" src="https://sboxcheckout-static.citruspay.com/bolt/run/bolt.min.js" bolt-
color="<color-code>"
bolt-logo="<image path>">
</script>
在沙箱上完成并测试集成后,将沙箱 JavaScript 库替换为 PayU 提供的生产库。
<script id="bolt" src="https://checkout-static.citruspay.com/bolt/run/bolt.min.js" bolt-color="<color-
code>"
bolt-logo="<image path>">
</script>