TPV Integration in UPI

For details on hash calculation for TPV, refer here

For UPI

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

Java
Kotlin
Java
// For single account number
mPaymentParams.setBeneficiaryAccountNumber("123456789");
// For multiple account numbers
mPaymentParams.setBeneficiaryAccountNumber("123456789|23456782|1234567");
Kotlin
// For single account number
mPaymentParams.beneficiaryAccountNumber = "123456789"
// For multiple account numbers
mPaymentParams.beneficiaryAccountNumber = "123456789|23456782|1234567"

For UPI Collect

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

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

‌For UPI INTENT

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

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