# TPV Integration in UPI

For details on hash calculation for TPV, refer [here](../../pg-sdk/tpv-integration#hash-calculation)

### **For UPI** <a href="#for-upi" id="for-upi"></a>

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

{% tabs %}
{% tab title="Java" %}
```java
// For single account number 
mPaymentParams.setBeneficiaryAccountNumber("123456789");
mPaymentParams.setIfscCode("SBIN000700");

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

```
{% endtab %}

{% tab title="Kotlin" %}
```kotlin
// For single account number 
mPaymentParams.beneficiaryAccountNumber = "123456789"
mPaymentParams.ifscCode = "SBIN000700"

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

```
{% endtab %}
{% endtabs %}

#### For UPI Collect

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

{% tabs %}
{% tab title="Java" %}
```java
‌     

// To provide customer VPA
   mPaymentParams.setVpa("valid VPA")‌;
   try {
            mPostData = new PaymentPostParams(mPaymentParams, PayuConstants.UPI).getPaymentPostParams();
        } catch (Exception e) {
            e.printStackTrace();
        }‌
```
{% endtab %}

{% tab title="Kotlin" %}
```kotlin
      // To provide customer VPA
        mPaymentParams.vpa = "valid VPA";
      try {
            mPostData = PaymentPostParams(mPaymentParams, PayuConstants.UPI).paymentPostParams
        } catch (Exception e) {
            e.printStackTrace();
        }‌
```
{% endtab %}
{% endtabs %}

#### ‌For UPI INTENT

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

{% tabs %}
{% tab title="Java" %}
```java
‌     try {
            mPostData = new PaymentPostParams(mPaymentParams, PayuConstants.UPI_INTENT).getPaymentPostParams();
        } catch (Exception e) {
            e.printStackTrace();
        }‌
```
{% endtab %}

{% tab title="Kotlin" %}
```kotlin
     try {
            mPostData = PaymentPostParams(mPaymentParams, PayuConstants.UPI_INTENT).paymentPostParams
        } catch (Exception e) {
            e.printStackTrace();
        }‌
```
{% endtab %}
{% endtabs %}
