0

I am trying to integrate Payment Gateway (PayU) in Android through WebView. I am able to send the data to the PayU through POST. After successful transaction, the page is not redirecting to the "surl" i.e successUrl / "furl" i.e FailureUrl. It always shows page not found.

Following is the code of WebView:

webView = (WebView) findViewById(R.id.webview1);
String postData = "Required Data sent to PayU by POST";
webView.setWebViewClient(new WebViewClient(){
    @Override
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
         Log.d("Page_Started",url);
    }

    @Override
    public void onPageFinished(WebView view, String url) {
         Log.d("Page_Finished",url);
    }
});

webView.getSettings().setUserAgentString("Mozilla/5.0 (Linux; U; Android 2.0; en-us; Droid Build/ESD20) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17");
webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setSupportMultipleWindows(true);
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webView.getSettings().setSupportZoom(true);       //Zoom Control on web (You don't need this
//if ROM supports Multi-Touch
webView.getSettings().setBuiltInZoomControls(true);
webView.postUrl(action, EncodingUtils.getBytes(postData, "BASE64"));

In Log, its not showing any success url / failure url. I always get a message from PayU that Page Not Found-404

Do I have to make some changes in webView? Its working perfect in WebPage, not working in Android.

Neha Shukla
  • 3,572
  • 5
  • 38
  • 69
  • facing similar issue, is there a proper technical documentation for android anywhere? – deepak Jun 18 '15 at 13:46
  • You can find it here. http://stackoverflow.com/questions/25383216/payumoney-post-integration-in-android-error – Akshat Oct 09 '15 at 08:33
  • You can find it here. [http://stackoverflow.com/questions/25383216/payumoney-post-integration-in-android-error] – Akshat Oct 09 '15 at 08:35

2 Answers2

0

After transaction Payu POST the transaction status response back your surl/furl according to the transaction status.

Please make sure that your surl/furl accept POST request.

HSpector
  • 11
  • 2
0

After a long searching and changing in code. Finally, i got proper solution of this problem. For testing just you this parameters, merchant key:"gtKFFx" , salt: "eCwWELxi". After launching payumoney screen. To enter debit card details use this details, Name on Card: Any name, Card Number: 5123456789012346, CVV: 123, Expiry Date: 05/2017. When i used this credentials and numbers it working very well and redirecting to my particular success URL.

Ronak Joshi
  • 1,553
  • 2
  • 20
  • 43
  • Hi Ronak, I'm using non-seamless integration using PayU sdk. I'm still getting same error even after using above credentials. can you help? – shraddha Dec 06 '16 at 12:54
  • I have not use PayU sdk. Try to use the webview for this and then use this credentials. – Ronak Joshi Dec 13 '16 at 06:46