Select Page

PayU Money with ASP.NET

We were struggling with PayUMoney integration with .Net code however steps are simple PayU provides API and documentation implementation. There are Couple of setting which is not in PayU documentation. You can use following document step by step complete process to set up your Payment gateway.

Here are the steps you need to follow to Integrated PayU with .NET (C#):

Create Pay now button in Your UI. These images below show example how we have done in our Application. You need to just change the connection string in your Case.

1

By clicking on “Pay Now” Application call PayNow() method

You have to write method like below. This method is provide by Paynow

Let me describe what parameter you will have to change in your case.

Note : The one in lined  in yellow are input parameter you to pass PayU function. These parameter would be in same syntax as shown below however it would change for your payU account and code.

Let me again define the parameters.

  1. In most of the case when you are setting payment mechanism in your application these are the parameter you ask customer to fill. You have to pass these parameter to Pay you. You can find in case of our application we have used below parameter which are being passed to pay you to process payment.

This is for fetching the URL of application where application is hosted. In   case your Application is hosted at www.abcd.com it will return abcd.

Here it will input your Url as http://abcd.com

  1. All these three setting you will get from your PayU account.

Next step is to call  PayNow() method

Please define PayUMoney Merchant key and SALT in your web config file like below.

Clicking on save executed  PayNow() Method and redirected  to User PayU login screen.

2

User need to fill payment details selecting payment method.3

After payment user can see its transaction details on PuyUMoney. 4

Once payment is complete  PayUMoney redirect to Retun() Method and read transactionId

from FormCollection

Using the payment method returned by PayU you can keep track of transaction ID and show success or failure message in your UI.

Complete Code