TPV Integration
For TPV transactions, you need to have different merchantID. Please contact your key account manager for same.

You can integrate TPV with BizSDK framework in below steps:

Hash Calculation

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:

1
// For single account number
2
beneficiarydetail = "{'beneficiaryAccountNumber':'123456789'}"
3
// For multiple account number
4
beneficiarydetail = "{'beneficiaryAccountNumber':'123456789|54321234|98765673|34767988'}"
5
// Hash calculation
6
Hash = sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||beneficiarydetail|SALT)
Copied!

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.
Objective-C
Swift
1
@property (nonatomic, strong) PayUCreateRequest *createRequest;
Copied!
1
let createRequest = PayUCreateRequest()
Copied!

For NetBanking

To Pay using NetBanking, we need to set NetBanking parameter as below:
Objective-C
Swift
1
self.paymentParamForPassing.beneficiaryAccountNumbers = @"123456789";
2
self.paymentParamForPassing.bankCode = @"AXNBTPV"; //BankCode
Copied!
1
paymentParamForPassing.beneficiaryAccountNumbers = "123456789"
2
paymentParamForPassing.bankCode = "AXNBTPV" //BankCode
Copied!
After setting the above parameters, you can get the request by using createRequestWithPaymentParam method as below
Objective-C
Swift
1
self.createRequest = [PayUCreateRequest new];
2
[self.createRequest createRequestWithPaymentParam:self.paymentParamForPassing forPaymentType:PAYMENT_PG_NET_BANKING withCompletionBlock:^(NSMutableURLRequest *request, NSString *postParam, NSString *error) {
3
if (error == nil) {
4
//It is good to go state. You can use request parameter in webview to open Payment Page
5
}
6
else{
7
//Something went wrong with Parameter, error contains the error Message string
8
}
9
}];
Copied!
1
createRequest.createRequest(withPaymentParam: paymentParamForPassing, forPaymentType: PAYMENT_PG_NET_BANKING, withCompletionBlock: { request, postParam, error in
2
if error == nil {
3
//It is good to go state. You can use request parameter in webview to open Payment Page
4
} else {
5
//Something went wrong with Parameter, error contains the error Message string
6
}
7
})
Copied!

For UPI

To Pay using UPI, we need to set UPI parameter as below:
Objective-C
Swift
1
// For single account number
2
self.paymentParamForPassing.beneficiaryAccountNumbers = @"123456789";
3
// For multiple account number
4
self.paymentParamForPassing.beneficiaryAccountNumbers = @"123456789|54321234|98765673|34767988";
5
// Set BankCode
6
self.paymentParamForPassing.bankCode = @"UPITPV"; // UPITPV or TEZTPV
7
// Set VPA
8
self.paymentParamForPassing.vpa = @"[email protected]";
Copied!
1
// For single account number
2
paymentParamForPassing.beneficiaryAccountNumbers = "123456789"
3
// For multiple account number
4
paymentParamForPassing.beneficiaryAccountNumbers = "123456789|54321234|98765673|34767988"
5
// Set BankCode
6
paymentParamForPassing.bankCode = "UPITPV" // UPITPV or TEZTPV
7
// Set VPA
8
paymentParamForPassing.vpa = "[email protected]"
Copied!
After setting the above parameters, you can get the request by using createRequestWithPaymentParam method as below
Objective-C
Swift
1
self.createRequest = [PayUCreateRequest new];
2
[self.createRequest createRequestWithPaymentParam:self.paymentParamForPassing forPaymentType:PAYMENT_PG_UPI withCompletionBlock:^(NSMutableURLRequest *request, NSString *postParam, NSString *error) {
3
if (error == nil) {
4
//It is good to go state. You can use request parameter in webview to open Payment Page
5
}
6
else{
7
//Something went wrong with Parameter, error contains the error Message string
8
}
9
}];
Copied!
1
createRequest.createRequest(withPaymentParam: paymentParamForPassing, forPaymentType: PAYMENT_PG_UPI, withCompletionBlock: { request, postParam, error in
2
if error == nil {
3
//It is good to go state. You can use request parameter in webview to open Payment Page
4
} else {
5
//Something went wrong with Parameter, error contains the error Message string
6
}
7
})
Copied!

Response Handling

It is same as you are handling for other payment option.
Last modified 1yr ago