Merchant When the Native Webview application loads PayPays Web Cashier URL in the same window, it may not be possible to properly request the redirect process from the user.
Changes have to be made in such a way that the web cashier URL is loaded in the new window with the simple snippet of code added below. And this change has to be done in merchant web applications.
window.open("<web_cashier URL>", "_blank");
For Android Only:
The other solution will be using the intent of native application OS to check and redirect to the browser.
val codeWeb: WebView = WebView(this)
val settings = codeWeb.settings
settings.domStorageEnabled = true
settings.javaScriptEnabled = true
codeWeb.loadUrl("<merchant web URL>")
codeWeb.webViewClient = object : WebViewClient() {
override fun shouldOverrideUrlLoading(
view: WebView?,
url: String?
): Boolean {
Log.i("shouldOverrideUrlLoading", "shouldOverrideUrlLoading: $url")
val intent: Intent
if (url != null) {
if (url.contains("<web-cashier host>")) {
// Current value of web cashier host:
// https://www.paypay.ne.jp/app/cashier
intent = Intent(Intent.ACTION_VIEW)
intent.data = Uri.parse(url)
startActivity(intent)
return true
}
}
return false
}
}