UPI Intent Autopay TPV Integration
Integrate TPV through UPI using the procedure described in this section.
Prerequisites
S2S (Seamless) integration has to be done as per the standard kit. For more information, refer to UPI Integrations - S2S.
Note:
Currently, PayU supports UPI Intent Autopay only with Seamless integration.
Step 1: Post the parameters to PayU
With the following parameters, make the transaction request with the customerβs bank account number to the PayU using the Collect Payment (_payment) API.
Environment
Test Environment | https://test.payu.in/_payment |
Production Environment | https://secure.payu.in/_payment |
Request parameters
In the merchant-initiated POST REQUEST, Hash is a mandatory parameter. It is critical to calculate the hash correctly and post it to PayU in the request.
Parameter | Description | Value |
---|---|---|
keymandatory | String The merchant key is a unique identifier for a merchant account in PayU's database. | Your Test Key |
api_versionoptional | String The API version for this API. | 7 |
txnidmandatory | String The transaction ID is a reference number for a specific order that is generated by the merchant. It is used to track the order and must be unique. PayU's system will not accept duplicate transaction IDs. | s7hhDQVWvbhBdN |
amountmandatory | String This field should contain the payment amount for the transaction.The limit for recurring payments using UPI payment mode: - Auto-debit is Rs.15000_ (the auto-debit limit is higher for below listed purpose) - With PIN is Rs.1,00,00 Note: The auto-debit limit for the following UPI recurring payments is one lakh rupees (Rs.1,00,000): - Insurance premiums - Credit card bill payments - Insurance premium | 10.00 |
productinfomandatory | String It should be a string containing a brief description of the product.Character Limit-100 | iPhone |
firstnamemandatory | String The first name of the customer.Character Limit-60 | Ashish |
emailmandatory | String The email of the customer.Character Limit-50 | [email protected] |
phonemandatory | String The phone number of the customer. | 9876543210 |
lastnamemandatory | String The last name of the customer.Character Limit-60 | Verma |
address1optional | String The first line of the billing address.Character Limit-100 | H.No- 17, Block C, Kalyan Bldg, Khardilkar Road, Mumbai |
address2optional | String The second line of the billing address.Character Limit-100 | 34 Saikripa-Estate, Tilak Nagar |
cityoptional | String The city where your customer resides as part of the billing address. | Mumbai |
stateoptional | String The state where your customer resides as part of the billing address, | Maharashtra |
countryoptional | String The country where your customer resides.Character Limit-50 | India |
zipcodeoptional | String Billing address zip code is mandatory for the cardless EMI option.Character Limit-20 | 400004 |
surlmandatory | String The "surl" field is the success URL, which is the page PayU will redirect to if the transaction is successful. The merchant can handle the response at this URL after the customer is redirected there. | https://apiplayground-response.herokuapp.com/ |
furlmandatory | String The "furl" field is the Failure URL, which is the page PayU will redirect to if the transaction is failed. The merchant can handle the response at this URL after the customer is redirected there. | https://apiplayground-response.herokuapp.com/ |
hashmandatory | String It is used to avoid the possibility of transaction tampering.Β For the hash checksum logic, refer to Checksum Logic for Hash. | eabec285da28fdβ¨0e3054d41a4d24feβ¨9f7599c9d0b6664β¨6f7a9984303fd612β¨4044b6206daf831β¨e9a8bda28a6200dβ¨318293a13d6c193β¨109b60bd4b4f8b09β¨c90972 |
pgmandatory | varchar The pg parameter for UPI must be UPI. | UPI |
bankcodemandatory | varchar This parameter contains INTTPV for UPI TPV Intent. | INTTPV |
simandatory | This parameter signifies a successful consent taken from the user by the merchant. This parameter must contain 1 for a successful consent. Without this parameter sent as 1, subscription cannot be set up. | |
si_detailsmandatory | This parameter represents mandatory details which need to be passed to during registration transaction from merchant system to PayU. Note: It is mandatory as per the latest RBI guidelines to pass this information to the payment processor so that same can be forwarded to acquirers and issuers ( for more details refer β https://www.rbi.org.in/Scripts/NotificationUser.aspx?Id=11668&Mode=0 ) This is a JSON object and it includes a set of fields. For more information, refer to SI Parameter JSON Details | |
beneficiarydetailmandatory | This is a JSON format text and there should be key named beneficiaryAccountNumber with the list of account numbers and the ifscCode key with the list of corresponding IFSC codes (in the same order as provided in the beneficiaryAccountNumber key). You can post up to five account details in this parameter. | Refer to beneficiarydetail JSON Object Fields |
beneficiarydetail JSON Object Fields
It must contain the list of account numbers and the ifscCode key with the list of corresponding IFSC codes (in the same order as provided in the beneficiaryAccountNumber key). You can post up to five account details in this parameter. For example:
{"beneficiaryAccountNumber":"002001600674|00000031957292212|00000035955239352|00000035955239352",
"ifscCode":"KTKB0000046|KTKB0000023|KTKB0000035|KTKB0000035"}
Checksum Logic for Hash
The following hash logic must be used for the parameters posted:
si_details parameter in Hashing:
The si_details parameter value will be at last or the last value to be appended.
key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3 |udf4|udf5||||||si_details|SALT
For more information on hash generation process, refer to Generate Hash
Step 2: 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|si_details|status||||||udf3|udf2|udf1|email|firstname|productinfo|amount|txnid|key)
Response parameters
For the response parameter description, refer to Additional Info for Payment APIs.
Store the mihpayid and txnid parameter values in response:
PayU recommends you to make provisions to store the mihpayid and txnid parameter values (in the response) in your server as proof that TPV has been completed for a customer.
Sample response
- Success scenario
On receiving valid request over PayUβs payment interface (_payment), PayU returns JSON object as response object similar to the following in INTENT :
{
"metaData":{
"message":null,
"referenceId":"5ae6e6d94b4b5f9dee282b95f6020c98",
"statusCode":null,
"txnId":"40d553e62525a03e5c54",
"txnStatus":"pending",
"unmappedStatus":"pending"
},
"result":{
"paymentId":"15257049438",
"merchantName":"smsplus",
"merchantVpa":"growfitter.payu@hdfcbank",
"amount":"1.90",
"intentURIData":"upi://mandate?pa=growfitter.payu@hdfcbank&pn=IBIBO GROUP PRIVATE LIMITED&mn=&tid=40d553e62525a03e5c54&validitystart=30052022&validityend=01092022
&am=10.00&amrule=MAX&recur=MONTHLY&recurvalue=30&recurtype=&tr=15257049438&cu=INR
&mc=5411&tn=UPI Transaction for 40d553e62525a03e5c54&mode=13&purpose=14
&orgid=159240&rev=Y&block=N&txnType=CREATE",
"postToBank":{
"token":"C6ABAA6A-F0CE-432A-61C1-CFA48EDE847B",
"amount":"1.90",
"mihpayid":"5ae6e6d94b4b5f9dee282b95f6020c98",
"disableIntentSeamlessFailure":"0",
"payeeVpa":"growfitter.payu@hdfcbank",
"payeeName":"smsplus",
"additionalCharges":0,
"transactionFee":"1.90"
},
"issuerUrl":"https://secure.payu.in\/591d096c5495eff4234e95eb64a1e1b8/intentSeamlessHa
ndler.php"
}
}
- Failure scenario
{
"metaData":{
"message":"Transaction failed due to invalid params shared by the merchant",
"referenceId":"dde7096af9db932a9fd09b9b4383d8be",
"statusCode":"E1101",
"txnId":"0c4931ddee7a4f69227f"
"txnStatus"": ""failed"","
"unmappedStatus"": ""failure""},""result""\": {}}"
}
Verify payment:
PayU recommends you. to verify the transaction details using the Verification Payment API. For more information, For API reference, refer to Verify Payment API.
Webhook response
You can also expose a webhook and needs to request Integration team PayU team to configure the same against βws_online_responseβ parameter. If this webhook is configured, merchant will receive above response object over HTTP form post method similar to the following:
mihpayid=700010006211076&mode=UPI&status=success&key=275Q84&txnid=11w2f611dbab91 79f1ee89&amount=10.00&addedon=2020-08- 21+02%3A11%3A08&productinfo=Product+Info&firstname=Payu- Admin&lastname=&address1=&address2=&city=&state=&country=&zipcode=&email=test%40exa mple.com&phone=1234567890&udf1=&udf2=&udf3=&udf4=Executed+Callback&udf5=&udf6=& udf7=&udf8=&udf9=&udf10=&card_token=&card_no=&field0=https%3A%2F%2Fwww.hdfc.co.in& field1=aastha%40hdfcbank&field2=HDFAD4C6BC943154ABAE0535CB2E20A7369&field3=aastha %40hdfcbank&field4=Aaaaaasthaaaa&field5=ad5626305e96efaae0535db2e20aa960%40hdfcbank &field6=HDFC0002373%7C50100101672620&field7=MD200%7CMandate+Request+Pending&fiel d8=&field9=Recurrence+Payment+Success%7CCompleted+Using+Callback&payment_source=sist& PG_TYPE=HDFCU+SI&error=E000&error_Message=No+Error&net_amount_debit=10&unmappedsta tus=captured&hash=f8be95fee8e73b8bdc0d22ee6627cc59237d4d69046db1b86580b1107affcf8fd 471743f94101b4fdd7f2184d8eb35bbbb95c77728189d50227629e75851a498&bank_ref_no=0234 02045965&bank_ref_num=023402045965&bankcode=UPI&surl=https%3A%2F%2Fbizcheckouttes t.payu.in%2Fadmin%2Ftest_response&curl=https%3A%2F%2Fbizcheckouttest.payu.in%2Fadmin%2 Ftest_response&furl=https%3A%2F%2Fbizcheckouttest.payu.in%2Fadmin%2Ftest_response
Updated 14 days ago