Decoupled Flow Integration
The S2S decoupled flow for cards with authentication only involves the following steps.
Before you begin:Register for an account with PayU before you start integration. For more information, refer to Register for a Merchant Account.
Step 1: Initiate payment request with PayU
Environment
| Test Environment | https://test.payu.in/_payment |
| Production Environment | https://secure.payu.in/_payment |
Mandatory Parameters
| Parameter | Description |
|---|---|
| key | String Merchant key provided by PayU during onboarding. |
| txnid | String The transaction ID is a reference number generated by the merchant. |
| amount | String The payment amount for the transaction. |
| productinfo | String A brief description of the product. |
| firstname | String The first name of the customer. |
String The email address of the customer. | |
| phone | String The phone number of the customer. |
| pg | String For cards, CC will be the value. |
| bankcode | String Each payment option is identified with a unique bank code at PayU. |
| ccnum | String Use 13-19 digit card number and validate with LUHN algorithm. |
| ccname | String The name on card as entered by the customer. |
| ccvv | String Use 3-digit CVV number. Validate with BIN API. |
| ccexpmon | String Card expiry month in MM format. |
| ccexpyr | String Card expiry year in four digits. |
| furl | String The failure URL for failed transactions. |
| surl | String The success URL for successful transactions. |
| hash | String key-512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||Salt) |
| txn_s2s_flow | String Must be passed with value 4 for Legacy Decoupled flow. |
| auth_only | String Must be passed with value 2 for authentication-only flow. |
| authentication_flow | String authentication flow type. Use "decoupled" for decoupled flow. |
Optional Parameters
| Parameter | Description |
|---|---|
| address1 | String The first line of the billing address. For Fraud Detection: helpful for fraud detection and chargebacks. |
| address2 | String The second line of the billing address. |
| city | String The city where the customer resides. |
| state | String The state where the customer resides. |
| country | String The country where the customer resides. |
| zipcode | String Billing address zip code. Mandatory for cardless EMI. Character Limit: 20. |
| udf1-udf5 | String User-defined fields for storing transaction-specific data. |
curl --location 'https://test.payu.in/_payment' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'key=YOUR_MERCHANT_KEY' \
--data-urlencode 'txnid=TXN_12345' \
--data-urlencode 'amount=10.00' \
--data-urlencode 'productinfo=iPhone' \
--data-urlencode 'firstname=Ashish' \
--data-urlencode '[email protected]' \
--data-urlencode 'phone=9876543210' \
--data-urlencode 'pg=CC' \
--data-urlencode 'bankcode=VISA' \
--data-urlencode 'ccnum=5123456789012346' \
--data-urlencode 'ccname=Ashish Kumar' \
--data-urlencode 'ccvv=123' \
--data-urlencode 'ccexpmon=10' \
--data-urlencode 'ccexpyr=2025' \
--data-urlencode 'surl=https://apiplayground-response.herokuapp.com/' \
--data-urlencode 'furl=https://apiplayground-response.herokuapp.com/' \
--data-urlencode 'txn_s2s_flow=4' \
--data-urlencode 'auth_only=2' \
--data-urlencode 'authentication_flow=decoupled' \
--data-urlencode 'hash=YOUR_HASH_VALUE'import requests
url="https://test.payu.in/_payment"
data={"key":"YOUR_MERCHANT_KEY","txnid":"TXN_12345","amount":"10.00","productinfo":"iPhone",
"firstname":"Ashish","email":"[email protected]","phone":"9876543210","pg":"CC","bankcode":"VISA",
"ccnum":"5123456789012346","ccname":"Ashish Kumar","ccvv":"123","ccexpmon":"10","ccexpyr":"2025",
"surl":"https://apiplayground-response.herokuapp.com/",
"furl":"https://apiplayground-response.herokuapp.com/",
"txn_s2s_flow":"4","auth_only":"2","authentication_flow":"decoupled","hash":"YOUR_HASH_VALUE"}
r=requests.post(url,headers={"Content-Type":"application/x-www-form-urlencoded"},data=data)
print(r.status_code); print(r.text)<?php /* Decoupled Flow S2S - PHP: same as classic + txn_s2s_flow=4, auth_only=2, authentication_flow=decoupled */ ?>// Decoupled Flow S2S - Java: same as classic + txn_s2s_flow=4, auth_only=2, authentication_flow=decoupled// Decoupled Flow S2S - C#: same as classic + txn_s2s_flow=4, auth_only=2, authentication_flow=decoupledStep 2: Redirect the customer
Redirect the customer to complete 3DS authentication.
Step 3: Check Authentication Status
Call the AuthData API to retrieve 3DS2 authentication results.
Updated 7 days ago
Did this page help you?
