For TPV transaction, hash calculation formula is different from normal type of payment:
For multiple account number, account number should be pipe separated and max 4 account numbers are allowed.
Hash Formula:
// For single account number
beneficiarydetail = "{'beneficiaryAccountNumber':'123456789'}"
// For multiple account number
beneficiarydetail = "{'beneficiaryAccountNumber':'123456789|54321234|98765673|34767988'}"
// Hash calculation
Hash = sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||beneficiarydetail|SALT)
Make Payment
To get request, create an object of class PayUCreateRequest as below. The callbacks give you NSURLRequest as well as post parameters (in String). You can use these post parameters to initialize Custom Browser Instance.
After setting the above parameters, you can get the request by using createRequestWithPaymentParam method as below
self.createRequest = [PayUCreateRequest new];
[self.createRequest createRequestWithPaymentParam:self.paymentParamForPassing forPaymentType:PAYMENT_PG_NET_BANKING withCompletionBlock:^(NSMutableURLRequest *request, NSString *postParam, NSString *error) {
if (error == nil) {
//It is good to go state. You can use request parameter in webview to open Payment Page
}
else{
//Something went wrong with Parameter, error contains the error Message string
}
}];
createRequest.createRequest(withPaymentParam: paymentParamForPassing, forPaymentType: PAYMENT_PG_NET_BANKING, withCompletionBlock: { request, postParam, error inif error ==nil {//It is good to go state. You can use request parameter in webview to open Payment Page } else {//Something went wrong with Parameter, error contains the error Message string }})
For UPI
To Pay using UPI, we need to set UPI parameter as below:
// For single account number
self.paymentParamForPassing.beneficiaryAccountNumbers = @"123456789";
// For multiple account number
self.paymentParamForPassing.beneficiaryAccountNumbers = @"123456789|54321234|98765673|34767988";
// Set BankCode
self.paymentParamForPassing.bankCode = @"UPITPV"; // UPITPV or TEZTPV
// Set VPA
self.paymentParamForPassing.vpa = @"umang@axis";
// For single account numberpaymentParamForPassing.beneficiaryAccountNumbers ="123456789"// For multiple account numberpaymentParamForPassing.beneficiaryAccountNumbers ="123456789|54321234|98765673|34767988"// Set BankCodepaymentParamForPassing.bankCode ="UPITPV"// UPITPV or TEZTPV// Set VPApaymentParamForPassing.vpa ="umang@axis"
After setting the above parameters, you can get the request by using createRequestWithPaymentParam method as below
self.createRequest = [PayUCreateRequest new];
[self.createRequest createRequestWithPaymentParam:self.paymentParamForPassing forPaymentType:PAYMENT_PG_UPI withCompletionBlock:^(NSMutableURLRequest *request, NSString *postParam, NSString *error) {
if (error == nil) {
//It is good to go state. You can use request parameter in webview to open Payment Page
}
else{
//Something went wrong with Parameter, error contains the error Message string
}
}];
createRequest.createRequest(withPaymentParam: paymentParamForPassing, forPaymentType: PAYMENT_PG_UPI, withCompletionBlock: { request, postParam, error inif error ==nil {//It is good to go state. You can use request parameter in webview to open Payment Page } else {//Something went wrong with Parameter, error contains the error Message string }})
Response Handling
It is same as you are handling for other payment option.