The PayU v2 seamless Net Banking integration allows merchants to collect Net Banking payments directly without redirecting customers to PayU's hosted checkout page.
📘
Note
This documentation covers seamless Net Banking integration. For hosted checkout flows, refer to the v2 Payment API (Non-Seamless) documentation.
The current date and time. For example, format of the date is Wed, 28 Jun 2023 11:25:19 GMT.
authorization
The actual HMAC signature generated using the specified algorithm (sha512) and includes the hashed data. For more information, refer to authorization fields description.
authorization fields description
Field
Description
username
Represents the username or identifier for the client or merchant, for example smsplus.
algorithm
Use SHA512 algorithm for hashing and send this as header value.
headers
Specifies which headers have been used in generating the hash, for example date.
signature
The HMAC signature generated using the specified algorithm. For more information, refer to hashing algorithm.
hashing algorithm
You must hash the request parameters using the following hash logic:
Where <Body data> contains the request body posted with the request.
Sample header code
var merchant_key = 'smsplus';
var merchant_secret = 'izF09TlpX4ZOwmf9MvXijwYsBPUmxYHD';
// date
var date = new Date();
date = date.toUTCString();
// authorization
var authorization = getAuthHeader(date);
function getAuthHeader(date) {
var AUTH_TYPE = 'sha512';
var data = isEmpty(request['data']) ? "" : request['data'];
var hash_string = data + '|' + date + '|' + merchant_secret;
var hash = CryptoJS.SHA512(hash_string).toString(CryptoJS.enc.Hex);
return `hmac username="${merchant_key}", algorithm="${AUTH_TYPE}", headers="date", signature="${hash}"`;
}
Request body
Parameter
Description
Example
accountId mandatory
Merchant key provided by PayU. Character limit: 50
"smsplus"
txnId mandatory
Unique transaction ID for the transaction. Character limit: 50
This parameter contains the status message of the transaction.
status
This parameter returns the status of web service call. The status can be any of the following:
`0` - If web service call failed.
`1` - If web service call succeeded.
result
This parameter contains the payment status details in a JSON format including payment ID of the transaction. For more detailes, refer to the result JSON Object fields description table (next accordion)
Sample response
Success scenario
Array
(
[txnId] => b5f2d8785768087678fm9
[paymentId] => 1999110000001769
[message] => Please call verify api to get the transaction status
)
Verify Payment
⚠️
Important
After creating a payment, you must call the Verify Payment API to get the final transaction status. Net Banking transactions may require additional verification steps.