TPV Integration

To pay using UPI, you need to pass a beneficiary account number parameter similar to the following code block:

πŸ“˜

Note

For details on hash calculation for TPV, refer to Hash Generation.

// 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 single account number 
mPaymentParams.beneficiaryAccountNumber = "123456789"
mPaymentParams.ifscCode = "SBIN000700"

// For multiple account numbers
mPaymentParams.beneficiaryAccountNumber = "123456789|23456782|1234567"  
mPaymentParams.ifscCode = "SBIN000700|KTKN2937492|ICIC0002522"

UPI Collect

After setting the above parameters for the UPI Collect transaction, you can get the payment post parameters using the following code block:

// To provide customer VPA
mPaymentParams.setVpa("valid VPA")β€Œ;
try {
mPostData = new PaymentPostParams(mPaymentParams, PayuConstants.UPITPV).getPaymentPostParams();
} catch (Exception e) {
e.printStackTrace();
}
      // To provide customer VPA
        mPaymentParams.vpa = "valid VPA";
      try {
            mPostData = PaymentPostParams(mPaymentParams, PayuConstants.UPI).paymentPostParams
        } catch (Exception e) {
            e.printStackTrace();
        }β€Œ

UPI Intent

After setting the above parameters for the UPI INTENT transaction, you can get the payment post parameters using the following code snippet:

try {
mPostData = new PaymentPostParams(mPaymentParams, PayuConstants.UPI_INTENT).getPaymentPostParams();
} catch (Exception e) {
e.printStackTrace();
}
     try {
            mPostData = PaymentPostParams(mPaymentParams, PayuConstants.UPI_INTENT).paymentPostParams
        } catch (Exception e) {
            e.printStackTrace();
        }β€Œ