1

I have the following:- 1. Xamarin form (ContentPage) with a button "Pay" 2. Droid project: PaymentGatewayActivator.cs which has the following code for PayUMoney payment gateway integration:

protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.PaymentGateway);
            webviewPayment = (WebView)FindViewById(Resource.Id.webView1);

            webviewPayment.Settings.JavaScriptEnabled = true;
            webviewPayment.Settings.SetSupportZoom(true);
            webviewPayment.Settings.DomStorageEnabled = true;
            webviewPayment.Settings.LoadWithOverviewMode = true;
            webviewPayment.Settings.UseWideViewPort = true;
            webviewPayment.Settings.CacheMode = CacheModes.NoCache;
            webviewPayment.Settings.SetSupportMultipleWindows(true);
            webviewPayment.Settings.JavaScriptCanOpenWindowsAutomatically = true;
            webviewPayment.AddJavascriptInterface(new PayUJavaScriptInterface(this), "");  //JavaInterface

            Java.Lang.StringBuilder url_s = new Java.Lang.StringBuilder();
            url_s.Append("https://test.payu.in/_payment");    //PauMoney Test URL        
            Log.Info(TAG, "call url " + url_s);

            PayUMoneyGateway gateway = new PayUMoneyGateway();
            byte[] data = Encoding.UTF8.GetBytes(gateway.GeneratePaymentPOSTForm());
            webviewPayment.PostUrl(url_s.ToString(), data);

            webviewPayment.SetWebViewClient(webViewClient);
        }

Following is the test hash_string:-

gtKFFx|a03e56bd50459806c84e|25|testproductServices|myFirstName|[email protected]|eCwWELxi

And the actual hash returned by gateway.GeneratePaymentPOSTForm()

edffe24d30100e7042e1af788d21db94ee97e76ee851f004c9815b291c355459f9b0423f3509002824c0adb09e5f3979d1c1916faa0e705ee37ed74a5b99c58d

I am getting following error: Error Reason: Invalid Amount

Check error screenshot

1 Answer 1

0

https://logeshpalani.blogspot.com/2020/07/xamarin-forms-payumoney-integration.html

this blog will help you todo this payumoney integration over WebView not using Xamarin. Because, there is no official SDK for Xamarin

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.