TPV Integration

You can integrate TPV with Core SDK 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:

// 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)

It is recommended to pass ifscCode for NB, UPI and TEZ TPV transactions. Hash calculation will include ifscCode as shown below

// For single ifsc code
beneficiarydetail = "{'beneficiaryAccountNumber':'917732227242','ifscCode':'SBIN000700'}"

// For multiple ifsc number
beneficiarydetail = "{'beneficiaryAccountNumber':'917732227242|72522762|283228235','ifscCode':'SBIN000700|KTKN2937492|ICIC0002522'}"    

// Hash calculation
Hash = sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||beneficiarydetail|SALT)

Make Payment

For NetBanking

‌To Pay using NetBanking, you need to pass payment params along with below additional params

mPaymentParams.setBeneficiaryAccountNumber("123456789");
mPaymentParams.setIfscCode("SBIN000700");
mPaymentParams.setBankCode("AXNBTPV");

‌After setting the above parameters, you can get the payment post params using below

     try {
            mPostData = new PaymentPostParams(mPaymentParams, PayuConstants.NB).getPaymentPostParams();
        } catch (Exception e) {
            e.printStackTrace();
        }‌

For UPI

‌To Pay using UPI, you need to pass beneficiaryAccountNumber param as below

// For single account number 
mPaymentParams.setBeneficiaryAccountNumber("123456789");
mPaymentParams.setIfscCode("SBIN000700");

// For multiple account numbers
mPaymentParams.setBeneficiaryAccountNumber("123456789|23456782|1234567");  
mPaymentParams.setIfscCode("SBIN000700|KTKN2937492|ICIC0002522");

For UPI Collect

After setting the above parameters for UPI Collect transaction, you can get the payment post params using below

‌     try {
            mPostData = new PaymentPostParams(mPaymentParams, PayuConstants.UPI).getPaymentPostParams();
        } catch (Exception e) {
            e.printStackTrace();
        }‌

For TEZ

For TEZ transaction, you can get the payment post params using below

‌     try {
            mPostData = new PaymentPostParams(mPaymentParams, PayuConstants.TEZ).getPaymentPostParams();
        } catch (Exception e) {
            e.printStackTrace();
        }

Last updated

Was this helpful?