Debit Card - Merchant Hosted Checkout

When your customer wants to opt for the EMI option with debit cards, you can use EMI APIs to check the pre-eligibility of the debit card and calculate the EMI amount, interest, processing fee, or No-Cost EMI, and tenure. If the customer is eligible, you can post the transaction with EMI conversion.

📘

Note:

You can create EMI offers using the PayU Dashboard and use them for collecting payments as described in this procedure. For more information, refer to the Create a No-Cost EMI Offer.

The following video explains how Debit Card EMIs will help your business and how to enable it:

Step 1: Check pre-EMI eligibility for debit card

After collecting the customer’s card and the amount to be paid, check the Pre-EMI eligibility based on the customer’s mobile number using the getCheckoutDetails API. For more information on how to use the getCheckoutDetails API, refer to Get Checkout Details API

Step 2: Calculate the EMI interest

Use the getEmiAmountAccordingToInterest API to calculate the EMI interest. For more information, refer to Get EMI According to Interest API.

Step 3: Post the transaction request and check response

Post the additional parameters for using the Debit Card EMI. For complete list of parameters, refer to Collect Payment API - EMI for the complete list parameters with Try It experience.

ParameterDescriptionExample
pg
mandatory
String It defines the payment category that the merchant wants the customer to see by default on the PayU’s payment page. In this example, "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.EMI03
ccnum
mandatory
String This parameter must contain the card (credit/debit) number entered by the customer for the transaction. For card number formats, refer to the Card Number Formats.5123456789012346
ccname
mandatory
String This parameter must contain the name on card – as entered by the customer for the transaction.Ashish
ccvv
mandatory
String The CVV number must be included in the API request as a parameter. The value for this parameter should be the CVV number entered by the customer for the transaction.
Note: If the customer is returning to your website to make a new purchase, you will need to fetch all of the customer's stored cards from PayU, collect the CVV for the card that they will be using, and include it in the API request.
123
ccexpmon
mandatory
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. 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.05
ccexpyr
mandatory
String This parameter must contain the card’s expiry year – as entered by the customer for the transaction. It must be of 4 digits.2022
threeDS2RequestData
conditional
JSON This parameter must contain the following information in JSON format. For more information, refer to Request Parameter for 3DS Secure 2.0 Transaction of Collect Payments with Cards.

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=H6mUfE0ccAY94j&amount=20000.00&firstname=Ashish&[email protected]&phone=9876543210&productinfo=iPhone&pg=EMI&bankcode=EMIA3&surl=https://apiplayground-response.herokuapp.com/&furl=https://apiplayground-response.herokuapp.com/&ccnum=5123456789012346&ccexpmon=05&ccexpyr=2022&ccvv=123&ccname=&hash=782057a8bb0288c858149b4805103befa22041bb3092bc45a813738b43742e31baeae92375be5286a98b44ed66c36121aba0fff6a3170339a4949bc880125d36"

Step 4: Check the PayU response

The formatted sample response body is similar to the following, and you need to look for the following parameters:

  • PG_TYPE
  • bankcode
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] => 9123412345
    [udf1] => 
    [udf2] => 
    [udf3] => 
    [udf4] => 
    [udf5] => 
    [udf6] => 
    [udf7] => 
    [udf8] => 
    [udf9] => 
    [udf10] => 
    [hash] => 10f8ead10cdf5f9b7bf9046987de046d63d62d6679dded9d5da8145f459066943570eec4aa184494ae77f99a8bcd55452af3c4eff0d7a7d3ba809c97b7c73045
    [field1] => 
    [field2] => 
    [field3] => 
    [field4] => 
    [field5] => 
    [field6] => 
    [field7] =>
    [field8] => 
    [field9] => Transaction Completed Successfully
    [payment_source] => payu
    [PG_TYPE] => EMI-PG
    [bank_ref_num] => 3d7cc4a4-00c8-4705-a0e7-5708d2c2bb75
    [bankcode]=> ICICID03
    [error] => E000
    [error_Message] => No Error
    [name_on_card] => payu
    [cardnum] =>437541XXXXXX2346
)