Cardless EMI - Merchant Hosted Checkout Integration
When your customer wants to opt for the Cardless EMI option, you can use the EMI APIs to check the customer’s eligibility and get the EMI amount, interest, processing fee, or No-Cost EMI and tenure. If the customer is eligible, you can post the Cardless EMI transaction.
Step 1: Check the cardless EMI eligibility
After collecting the customer’s mobile number and the amount to be paid, check the Cardless EMI eligibility based on the customer’s mobile using the Get Checkout Details API (get_checkout_details) API. For more information, refer to Get Checkout Details API
Step 2: Initiate the payment
Post the following additional parameters for using the Cardless EMI. Check the response when you try enter the values in API Reference. For complete list of parameters, refer to Collect Payment API - EMI for the complete list parameters with Try It experience.
Parameter | Description | Example |
---|---|---|
keymandatory | String Merchant key provided by PayU during onboarding. | |
txnidmandatory | String The transaction ID is a reference number for a specific order that is generated by the merchant. | |
amount mandatory | String The payment amount for the transaction. | |
productinfo mandatory | String A brief description of the product. | |
firstname mandatory | String The first name of the customer. | Ashish |
emailmandatory | String The email address of the customer. | |
panNumbermandatory for ICICI, HDFC Bank, and Homecredit Cardless EMI. Not mandatory for other banks | String PAN number of the customer. | ABCTY1234D |
phonemandatory | String The phone number of the customer. | |
pgmandatory | String It defines the payment category that the merchant wants the customer to see by default on the PayU’s payment page. In this integration, "EMI" must be specified. | EMI |
bankcode mandatory | String Post this parameter to identify payment options with unique bank codes and use getEmiAmountAccordingToInterest API to check for EMI code for corresponding tenure. For the list of EMI codes, refer to EMI Codes . | HDFCCL06 |
ccnummandatory only for Bajaj Finserv | String Use 13-19 digit card number for credit/debit cards (15 digits for AMEX, 13-19 for Maestro) and validate with LUHN algorithm. Refer to Card Number Formats and display error message on invalid input. | 5123456789012346 |
ccnameoptional | String This parameter must contain the name on card – as entered by the customer for the transaction. | Ashish Kumar |
ccvvoptional | String Use 3-digit CVV number for credit/debit cards and 4-digit security code (4DBC/CID) for AMEX cards. Validate with BIN API. | 123 |
ccexpmon optional | String This parameter must contain the card’s expiry month – as entered by the user for the transaction. It must always be in 2 digits or in MM format. For months 1-9, this parameter must be appended with 0 – like 01, 02…09. For months 10-12, this parameter must not be appended – It should be 10,11 and 12 respectively. | 10 |
ccexpyroptional | String This parameter must contain the card’s expiry year – as entered by the customer for the transaction. It must be of four digits. | 2021 |
furlmandatory | String The success URL, which is the page PayU will redirect to if the transaction is successful. | |
surlmandatory | String The Failure URL, which is the page PayU will redirect to if the transaction is failed. | |
hashmandatory | String It is the hash calculated by the merchant. The hash calculation logic is:sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT) | |
address1optional | String The first line of the billing address.For Fraud Detection: This information is helpful when it comes to issues related to fraud detection and chargebacks. Hence, it is must to provide the correct information. | |
address2optional | String The second line of the billing address. | |
cityoptional | String The city where your customer resides as part of the billing address. | |
stateoptional | String The state where your customer resides as part of the billing address, | |
countryoptional | String The country where your customer resides. | |
zipcodeoptional | String Billing address zip code is mandatory for the cardless EMI option.Character Limit -20 | |
udf1optional | String User-defined fields (udf) are used to store any information corresponding to a particular transaction. You can use up to five udfs in the post designated as udf1, udf2, udf3, udf4, udf5. | |
udf2optional | String User-defined fields (udf) are used to store any information corresponding to a particular transaction. You can use up to five udfs in the post designated as udf1, udf2, udf3, udf4, udf5. | |
udf3optional | String User-defined fields (udf) are used to store any information corresponding to a particular transaction. | |
udf4optional | String User-defined fields (udf) are used to store any information corresponding to a particular transaction. | |
udf5optional | String User-defined fields (udf) are used to store any information corresponding to a particular transaction. |
Notes for panNumber:
- Only 4-digit number of the PAN**: Pass the 4-digit numeral in a sequential order as in the PAN.
- This parameter is mandatory for ICICI Bank and HDFC Bank Cardless EMI. Not mandatory for other banks
- The data validation performed is either the whole PAN card number or 4-dig-t number of the PAN.
- Whole PAN card Number: For validating the whole PAN Card number:
- It should be ten characters long.
- The first five characters should be any upper case alphabets.
- The next four-characters should be any number from 0 to 9.
- The last(tenth) character should be any upper case alphabet. It should not contain any white spaces.
Hashing
You must hash the request parameters using the following hash logic:
sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT)
For more information, refer to Generate Hash.
Sample request
curl -X POST "https://test.payu.in/_payment-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d"key=JP***g&txnid=EaE4ZO3vU4iPsp&amount=10.00&firstname=Ashish&[email protected]&phone=9876543210&productinfo=iPhone&pg=EMI&bankcode=EMI03&surl=https://apiplayground-response.herokuapp.com/&furl=https://apiplayground-response.herokuapp.com/&ccnum=1234&ccexpmon=05&ccexpyr=2022&ccvv=123&ccname=undefined&store_card_token=1234 4567 2456 3566&storecard_token_type=1&additional_info={“last4Digits”: “1234”, “tavv”: “ABCDEFGH”,”trid”:”1234567890”, “tokenRefNo”:”abcde123456”}&hash=fc3206829a6b4f8e300aeefb8f91add568b83dc90d01383a8e16553cc9600a3aefd4be2e370d32f0315ef1b9f28740515a9556b55abfefa7b54b434f894c9304"
Step 3: Check the response from PayU
Hash validation logic for payment response (Reverse Hashing)
While sending the response, PayU takes the exact same parameters that were sent in the request (in reverse order) to calculate the hash and returns it to you. You must verify the hash and then mark a transaction as a success or failure. This is to make sure the transaction has not tampered within the response.
The order of the parameters is similar to the following code block:
sha512(SALT|status||||||udf5|udf4|udf3|udf2|udf1|email|firstname|productinfo|amount|txnid|key)
Sample response
Array
(
[mihpayid] => 403993715523602563
[status] => success
[unmappedstatus] => captured
[key] => smsplus
[txnid] => v2tWbbdUOuacK9
[amount] => 20000.00
[discount] => 0.00
[net_amount_debit] => 20000.00
[addedon] => 2021-07-27 11:14:44
[productinfo] => iPhone
[firstname] => Ashish
[lastname] =>
[address1] =>
[address2] =>
[city] =>
[state] =>
[country] =>
[zipcode] =>
[email] => [email protected]
[phone] => 1234567890
[udf1] =>
[udf2] =>
[udf3] =>
[udf4] =>
[udf5] =>
[udf6] =>
[udf7] =>
[udf8] =>
[udf9] =>
[udf10] =>
[hash] => 10f8ead10cdf5f9b7bf9046987de046d63d62d6679dded9d5da8145f459066943570eec4aa184494ae77f99a8bcd55452af3c4eff0d7a7d3ba809c97b7c73045
[field1] => 0608273386032718000015
[field2] => 986987
[field3] => 10.00
[field4] => 403993715524069222
[field5] => 100
[field6] => 02
[field7] => AUTHPOSITIVE
[field8] =>
[field9] => Transaction is Successful [payment_source] => payu
[PG_TYPE] => EMI-PG
[bank_ref_num] => 3d7cc4a4-00c8-4705-a0e7-5708d2c2bb75
[bankcode]=> EMIA3
[error] => E000
[error_Message] => No Error
[name_on_card] => payu
[cardnum] =>XXXXXXXXXXXX1234
)
Updated 2 months ago