1. PayPay for Developers FAQ
  2. en
  3. I'm trying to call the PayPay payment screen in Webview, but it doesn't work properly.

PayPay for Developers FAQ

I'm trying to call the PayPay payment screen in Webview, but it doesn't work properly.

Merchant When the Native Webview application loads PayPay's 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

           }

       }

参考になりましたか?

送信しました。回答ありがとうございました。

解決しなかった場合は

フォームでお問い合わせ