Redirect Checkout

PayUmoney Redirect Checkout is a quick and easy way to integrate the payment checkout experience in your Website. Accept payments on your website, with built-in support for PayUmoney Wallet & Saved Cards.

Checkout Pages are served from PayUmoney Servers which are PCI DSS compliant so that the merchant does not have to worry about the PCI DSS hassles.

Have a look at the animated image below to understand payment collection through PayUmoney Redirect Checkout.

Why should you choose PayUmoney Redirect Checkout?

  • Super Easy Plug N Play Integration

Integration requires very few lines of code and requires only basic client and server side programming skills.

  • No PCI-DSS Compliance Required

Check out Pages are served from PayU Servers which are PCI DSS compliant so that the merchant does not have to worry about the PCI DSS hassles.

  • Zero Dev Hours on Enhancement/Fixes

Your Payments are our business.As a merchant, you do not have to make any change in case we release an enhancement or fix a bug so that you can just focus on your core business once PayUmoney is integrated.

  • Mobile Friendly Checkout Pages

The PayUmoney check out pages are mobile friendly and works awesomely with all devices and browsers.It is the perfect integrate once use everywhere solution.

  • Intuitive UI

We have used all our experience and data in Payment domain to create our world class check out experiences which will maximize your success rates.Also, any new payment mode or feature will be supported on the checkout page without you having to worry about the design or development aspect of it.

Features Supported

The following features are supported in the PayUmoney Redirect Checkout.

Payment Modes Supported

The PayUmoney Redirect Checkout supports the following Payment Modes.

Steps to Integrate

1
Prerequisites

Meet the Prerequisites

2
Client Side Changes

Create an HTML form as shown in the guide

3
Server Side Changes

Create a request hash as shown in the sample code

4
Initiate Transaction Request

Set transaction details on the HTML form and Submit to PayUmoney

5
Response Handling

Verify response hash and display transaction status to the customer.

Integration Kits Available

Sample integrations kits for the following technologies are available with PayUmoney.

Platforms Supported

Plugins for the following platforms are supported by PayUmoney.

Getting Started

This section describes the how to do the technical integration between PayUmoney Payment Gateway and your website for collecting payment online. This Checkout handles collecting, saving, and reusing your user's payment details, also can be used to collect billing info.

The Redirect Checkout provides your users with a streamlined, mobile-ready payment experience that is constantly improving. If you need any help after reading this, check out the FAQs section.

The payment request is essentially submitting a HTML Form prefilled with transaction details. The integration requires basic HTML skills and intermediate level knowledge in your favourite server-side programming language.

Steps to Integrate

1
Prerequisites

Meet the Prerequisites

2
Client Side Changes

Create an HTML form as shown in the guide

3
Server Side Changes

Create a request hash as shown in the sample code

4
Initiate Transaction Request

Set transaction details on the HTML form and Submit to PayUmoney

5
Response Handling

Verify response hash and display transaction status to the customer.

Prerequisites

To Integrate PayUmoney Redirect Checkout, you must :

  • Signup with PayUmoney as merchant
  • Get the Key and Salt, which are available on your merchant dashboard

Client Side Changes

The client side changes include creating an HTML Form as shown below and populating this form with values. The elements of this HTML Form are the request parameters to PayUmoney Redirect Checkout.

Once the form elements are populated appropriately, the HTML Form should be submitted to the action URL https://secure.payu.in/_payment on production or https://test.payu.in/_payment while testing.

A sample HTML form to be submitted to PayUmoney as the transaction request is shown below. You may copy the code below and apply your custom CSS to match your website styling and design to create your pre-checkout page.

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head >
</head>
<body>
<h1>PayUMoney Payment Request Form </h1>
<form action="myServlet"  name="payuform" method=POST >
<input type="hidden" name="key"value="UFu3ed" />
<input type="hidden" name="hash_string" value="" />
<input type="hidden" name="hash" />
<input type="hidden" name="txnid"/>
<table>
<tr>
<td><b>Mandatory Parameters</b></td>
</tr>
<tr>
<td>Amount: </td>
<td><input name="amount"  /></td>
<td>First Name: </td>
<td><input name="firstname" id="firstname"  /></td>
</tr>
<tr>
<td>Email: </td>
<td><input name="email" id="email"   /></td>
<td>Phone: </td>
<td><input name="phone"  /></td>
</tr>
<tr>
<td>Product Info: </td>
<td colspan="3"><textarea name="productinfo" >  </textarea></td>
</tr>
<tr>
<td>Success URI: </td>
<td colspan="3"><input name="surl"  size="64"  /></td>
</tr>
<tr>
<td>Failure URI: </td>
<td colspan="3"><input name="furl"  size="64" /></td>
</tr>
<tr>
<td colspan="3"><input type="hidden" name="service_provider" value="payu_paisa" /></td>
</tr>
<tr>
<td><b>Optional Parameters</b></td>
</tr>
<tr>
<td>Last Name: </td>
<td><input name="lastname" id="lastname"  /></td>
<td>Cancel URI: </td>
<td><input name="curl" value="" /></td>
</tr>
<tr>
<td>Address1: </td>
<td><input name="address1" /></td>
<td>Address2: </td>
<td><input name="address2"  /></td>
</tr>
<tr>
<td>City: </td>
<td><input name="city"  /></td>
<td>State: </td>
<td><input name="state"  /></td>
</tr>
<tr>
<td>Country: </td>
<td><input name="country"  /></td>
<td>Zipcode: </td>
<td><input name="zipcode"  /></td>
</tr>
<tr>
<td>UDF1: </td>
<td><input name="udf1"  /></td>
<td>UDF2: </td>
<td><input name="udf2"  /></td>
</tr>
<tr>
<td>UDF3: </td>
<td><input name="udf3"   /></td>
<td>UDF4: </td>
<td><input name="udf4"  /></td>
</tr>
<tr>
<td>UDF5: </td>
<td><input name="udf5"  /></td>
<td>PG: </td>
<td><input name="pg"  /></td>
</tr>
<td colspan="4"><input type="submit" value="Submit"  /></td>
</tr>
</table>
</form>
</body>
</html>

Details of the transaction parameters mentioned in the HTML form above are explained in the following table.

S.No. Parameter Name Mandatory Description
1. key Yes Merchant Key provided by PayUMoney. This is available on the dashboard.
2. txnid Yes A Unique alphanumeric Transaction ID generated by you to uniquely identify a transaction.  String value.  Limit 30 characters
3. amount Yes Transaction amount (Type cast the amount to float)
4. productinfo Yes Product Description.Pass your product information as text here if you are not an aggregator. If you are an aggregator, a JSON value needs to be passed here as explained in aggregator section.
5. firstname Yes First Name of the payer. Allowed characters: (only alphabets a-z are allowed)
6. email Yes Email Id of the payer.
7. phone Yes mobile number or landline number of the payer (numeric value only)
8. surl Yes Success URL where PayUMoney will redirect after successful payment.
9. furl Yes Failure URL where PayUMoney will redirect after failed payment.
10. hash Yes This is an encrypted value generated to protect against data tampering during transaction. PayUmoney uses SHA-512 hash function which belong to SHA-2 Familty of Cryptographic functions. hash = sha512(key|txnid|amount|productinfo|firstname|email|u df1|udf2|udf3|udf4|udf5||||||salt) (SALT will be provided by PayUMoney)
11. service_provider Yes Always pass 'payu_paisa'.
12. lastname No Last Name of the payer. Allowed characters: (only alphabets a-z are allowed)
13. address1 No Address of the payer. Allowed characters: (Length of address1 and address2 must not more than 100 characters each and the allowed characters are only) A TO Z, a to z, 0 to 9, @, - (Minus), _ (Underscore), / (Backslash), (Space), (Dot).
14. address2 No Address of the payer. Allowed characters: (Length of address1 and address2 must not more than 100 characters each and the allowed characters are only) A TO Z, a to z, 0 to 9, @, - (Minus), _ (Underscore), / (Backslash), (Space), (Dot)
15. city No City of the payer. Allowed characters: (Length of address1 and address2 must not more than 100 characters each and the allowed characters are only) A TO Z, a to z, 0 to 9, @, - (Minus), _ (Underscore), / (Backslash), (Space), (Dot)
16. state No Address State of the payer. Allowed characters: (Length of address1 and address2 must not more than 100 characters each and the allowed characters are only) A TO Z, a to z, 0 to 9, @, - (Minus), _ (Underscore), / (Backslash), (Space), (Dot)
17. country No Country of the payer. Allowed characters: (Length of address1 and address2 must not more than 100 characters each and the allowed characters are only) A TO Z, a to z, 0 to 9, @, - (Minus), _ (Underscore), / (Backslash), (Space), (Dot)
18. zipcode No Zipcode of the payer. Numeric value only
19. udf1 No User Defined Field 3
20. udf2 No User Defined Field 3
21. udf3 No User Defined Field 3
22. udf4 No User Defined Field 4
23. udf5 No User Defined Field 5
Note:
If you are an aggregator, a JSON value needs to be passed in the productinfo parameter, with details of child merchant/seller to be credited along with the payout details.Check aggregator section for more details.

Server Side Changes

The only server side change required while integrating PayUmoney checkouts is to generate a hash parameter for both the payment request & response.

A hash is an encrypted value (checksum) that is to be sent by the merchant in a payment request and sent by PayU in the payment response. The hash is used to protect transactions against "man in the middle attack".

PayUmoney uses the SHA-512 hash function which belongs to SHA-2 family of cryptographic functions. We have sample codes for generating the hash on major programming languages in this guide, however, if your preferred language is not in the list, a search on Google should definitely get you what you need.

The method of generating a request & response hash are exactly the same. Only the pattern and parameters to be encrypted differ.

Hash for Payment Request

hashSequence = key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||salt.
$hash = hash("sha512", $hashSequence);
Where salt is available on the PayUMoney dashboard.
Note:
A blank udf field is to be used while computing hashSequence, even if a merchant is not passing any udf field in input request.

Hash for Normal Payment Response

For the response hash, the sequence of variables is in reverse order as compared to payment request hash. Also, a status variable added between salt and udf1

hashSequence = salt|status||||||udf5|udf4|udf3|udf2|udf1|email|firstname|productinfo|amount|txnid|key
$hash = hash("sha512", $hashSequence);
Where salt is available on the PayUMoney dashboard.

Hash for Payment Response with Convenience Fee/Surcharge

For some of the merchants (mostly government entities), the transaction processing charges are paid by the consumer during payment. PayUmoney adds the payment extra processing charges to the transaction amount on the checkout page based on rules previously set based on the contract. In such cases/ for such merchants, an additional param by the name ‘additionalCharges’ is returned by PayUmoney in the transaction response. This parameter should also be used while computing response hash for transactions where customer incurred additional charges as shown below.

hashSequence = additionalCharges|salt|status||||||udf5|udf4|udf3|udf2|udf1|email|firstname|productinfo|a mount|txnid|key
$hash = hash("sha512", $hashSequence);
Where salt is available on the PayUMoney dashboard.

Sample Integration Kits

Download sample integration kit of your favourite programming language, especially if you have any doubts on hash generation.

Initiate Transaction Request

Once customer clicks submit after all the mandatory parameters are filled on the pre-checkout page HTML form, he or she is redirected to the PayUmoney checkout page shown below.

The Customer will now interact with PayUmoney screens till the transaction is complete.

Response Handling

Making a payment using PayUmoney redirect checkout gives two types of payment response:

  • A client-side response on the Success or Failure URL (SURL/FURL)
  • A server to server callback on the Webhook, if set from the PayUmoney dashboard.

Before transaction response is displayed to the user, please verify the authenticity of the transaction by generating a response hash. The hash generated by you should match the one sent by PayUmoney in response.

Note:
It is mandatory for the merchant to generate the response hash and check if it matches with the hash sent in the response by PayUmoney or your integration will be susceptible to the man in the middle attacks.

A list of the important response parameters sent by PayUmoney are shown in the table below. These parameters are posted as query params on the SURL/FURL/Webhook url.

RESPONSE PARAMETERS

S.No. Parameter Name Description Sample Value
1. status Transaction Status. (Described in detail in the Transaction Status section) success;
2. firstname Firstname of the payer Tom
3. amount Transaction Amount 1.0;
4. txnid Transaction Id passed by the merchant 0nf725;
5. hash Security hash generated in response to protect against data tampering.Merchant is required to generate a response hash and verify it against this hash. 127e2c44016aa4c3dd5bacc09b0239b09c6174f275c0ec4c8ec7da3db915a754407849cf2537f8655255ac54ee652c4ef972c721462ec9d0a67c08b66bdbb6ba;
6. productinfo Book1
7. mobile Mobile No of the payer 7406740707;
8. email Email Id of the payer abc@payu.in
9. payuMoneyId The payUmoney transaction id. 144190307;
10. mode Payment Mode in: Netbanking (NB) Debit Card(DC) Credit Card(CC) NB

Transaction Status

A transaction can have several different statuses as explained in the table below.

No Status Description
1. Not Started The transaction has not been started yet.
2. Initiated The transaction has been started but not completed.
3. Money With PayUMoney The transaction was successful and the transaction amount is with PayUMoney.
4. Under Dispute A dispute for the transaction has been raised.
5. Refunded The entire amount of the transaction has been refunded.
6. Partially Refunded A part of the amount of the transaction has been refunded.
7. Bounced Incomplete or no details provided at PayUMoney payment page.
8. Failed The transaction didn't complete due to a failure.
9. Settlement in Process Settlement for the transaction is in process.
10. Completed The transaction is settled and complete.