You can collect payments from customers with leading wallets using the Merchant Hosted integration. You need to ensure that CreditCard or DebitCard for the paymentMethod.name parameter and card code based on the desired card provider for the paymentMethod.bankcode parameter is posted.
📘
Note: PayU accepts domestic and international transactions, but international transactions need to be enabled by writing to PayU Integration Team ([email protected]).
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
Represents the merchant key provided by PayU during onboarding.
MERCHANT123
txnId mandatory
Transaction ID for transaction tracking. Must be unique for every transaction.
Contains transaction order details such as product info, ordered items, user-defined fields, and payment charge details. For more information, refer to order Object.
Object
additionalInfo mandatory
Additional metadata for the transaction. For more information, refer to additionalInfo Object.
Object
callBackActions mandatory
URL actions for payments (e.g., success, failure, cancel). For more information, refer to callBackActions Object.
Object
billingDetails mandatory
Customer billing details including name, phone, and address. For more information, refer to billingDetails Object.
Object
authorization mandatory
Authorization details for the payment process, including 3DS metadata. For more information, refer to authorization Object.
Object
paymentMethod object fields description
Parameter
Description
Example
name mandatory
Represents the payment method used. For credit card, include CreditCard.
CreditCard
bankCode mandatory
Contains the bank code. Valid values: CC, MAST, VISA.
CC
paymentCard mandatory for cards
Contains physical card or saved card details. For more information, refer to
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
Array
(
[txnId] => b5f2d8785768087678fm9
[paymentId] => 1999110000001769
[message] => Please call verify api to get the transaction status
)