Set up the payment hashes
(Mandatory Step)
For details on static and dynamic hashes check here.
Passing static hashes
For passing static hashes during integration, use below code:
var payUPaymentParams = {
key: "Merchant key",
...
...
...
additionalParam: {
payment_related_details_for_mobile_sdk: "payment_related_details_for_mobile_sdk hash",
vas_for_mobile_sdk: "vas_for_mobile_sdk hash",
payment: "Payment Hash"
}
}
Passing dynamic hashes
For passing dynamic hashes, merchant will receive a call on the method generateHash.
In the method parameter you will receive a dictionary or hashMap, extract the value of hashString from that. Pass that value to server, now server will append salt at the end and generate sha512 hash over it. Server will give that hash back to your app and app will give that hash to us via callback mechanism.
For passing dynamic hashes during integration, use below code:
generateHash = (e) => {
console.log(e.hashName);
console.log(e.hashString);
var hashStringWithoutSalt = e.hashString;
var hashName = e.hashName;
// Pass hashStringWithoutSalt to server
// Server will append salt at the end and generate sha512 hash over it
var hashValue = "<Set hash here which is fetched from server>";
var result = { [hashName]: hashValue };
PayUBizSdk.hashGenerated(result);
}
Last updated
Was this helpful?