PayUMoney redirecting page after successful transaction

跟風遠走 提交于 2020-01-06 15:17:23

问题


I am developing a sample application with PayUMoney Transaction. The app functions well. But I am looking for redirecting the page to an Activity after the successful transaction. I am using payUMoney SDK Does anyone gone through this? Please guide me.. any kind of help appreciated. Thanks in advance


回答1:


I faced the similar issue.I assume you have integrated payUMoney using sdk. Your sdk will be having a WebViewActivity which is used to redirect user to success/failure screen after transcation has been completed. Add a button on server side naming "ok" or "continue" on success/failure url screen.Detect click of that button in your SDK's WebView Activity and finish the activity.

Ask your web developer to add an html button on success/failure url:

<button type="button" onclick="ok.performClick();">OK</button>

This is how you can detect click on an html button in WebViewActivity of your SDK:

 mWebView = (WebView) findViewById(R.id.webview);
            mWebView.getSettings().setJavaScriptEnabled(true);
            mWebView.getSettings().setDomStorageEnabled(true);
            mWebView.getSettings().setLoadWithOverviewMode(true);
            mWebView.getSettings().setUseWideViewPort(true);
            WebSettings ws = mWebView.getSettings();
            mWebView.addJavascriptInterface(new Object()
            {
                @JavascriptInterface
                public void performClick(String status)
                {
                    // Deal with a click on the OK button
                    //    Toast.makeText(mContext,"Payment Success",2000).show();
                    //  Log.e("status payment-------->",status);
                    finish();

                }
            }, "ok");


来源:https://stackoverflow.com/questions/39248557/payumoney-redirecting-page-after-successful-transaction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!