Build the Payment Params

(Mandatory Step)

Step 2: Build the Payment Params

To initiate a payment, your app will need to send transactional information to the Checkout Pro SDK. To pass this information, build a payment parameter object as below

PayUPaymentParams.Builder builder = new PayUPaymentParams.Builder(); 
builder.setAmount(<String>)  
        .setIsProduction(<Boolean>)  
        .setProductInfo(<String>)   
        .setKey(<String>)      
        .setPhone(<String>)      
        .setTransactionId(<String>)  
        .setFirstName(<String>) 
        .setEmail(<String>) 
        .setSurl(<String>) 
        .setFurl(<String>) 
        .setUserCredential(<String>) 
        .setAdditionalParams(<HashMap<String,Object>>); //Optional, can contain any additional PG params  
PayUPaymentParams payUPaymentParams = builder.build(); 

For Recurring Payments(SI)

If you are integrating SI, then generate below payment params additionally

PayUSIParams siDetails  = new PayUSIParams.Builder()
                .setIsFreeTrial(true) //set it to true for free trial. Default value is false 
                .setBillingAmount("1.0")
                .setBillingCycle(PayUBillingCycle.ONCE)     
                .setBillingCurrency("INR")
                .setBillingInterval(1)
                .setPaymentStartDate("2021-12-24")
                .setPaymentEndDate("2021-12-31")
                .setBillingRule(PayuBillingRule.MAX)
                .setBillingLimit(PayuBillingLimit.ON)
                .setRemarks("SI Txn")
                .build();

Refer here for more details on all params used in PayUSIParams. After creating above PayUSIParams object, set it in the PayUPaymentParams object. For SI, complete PayUPaymentParams looks like below

PayUPaymentParams.Builder builder = new PayUPaymentParams.Builder(); 
builder.setAmount(<String>)  
        .setIsProduction(<Boolean>)  
        .setProductInfo(<String>)   
        .setKey(<String>)      
        .setPhone(<String>)      
        .setTransactionId(<String>)  
        .setFirstName(<String>) 
        .setEmail(<String>) 
        .setSurl(<String>) 
        .setFurl(<String>) 
        .setUserCredential(<String>) 
        .setAdditionalParams(<HashMap<String,Object>>); //Optional, can contain any additional PG params  
        .setPayUSIParams(siDetails);
PayUPaymentParams payUPaymentParams = builder.build(); 

Payment Param Definitions

Parameter

Type

Description

Data Type & Validation

Mandatory

Amount

String

Total transaction amount

Can not be null or empty and should be valid double stringified eg, “100.0”

Yes

Product info

String

Information about product

Can not be null or empty

Yes

Key

String

Merchant key received from PayU

Can not be null or empty

Yes

isProduction

Boolean

Environment of SDK. Set to true for Production else false

Should be a Boolean value. Default value is true

No

Phone

String

Customer’s phone number

Should be of 10 digits

No

TransactionId

String

It should be unique for each transaction

Should be unique for each transaction

Yes

First Name

String

Customer’s first name

Can not be null or empty

Yes

Email

String

Customer’s email id

Can not be null or empty

Yes

Surl

String

When the transaction is successful, PayU will load this url and pass transaction response

Can not be null or empty

Yes

Furl

String

When the transaction is a failure, PayU will load this url and pass transaction response

Can not be null or empty

Yes

User Credential

String

This is used for the store card feature. PayU will store cards corresponding to passed user credentials and similarly, user credentials will be used to access previously saved cards

Should be a unique value

Format : <merchantKey>:<userId>

Here,

UserId is any id/email/phone number to uniquely identify the user

No

PayUSIParams

Object of PayUSIParams

This contains SI Details

Object of PayUSIParams

No

Additional parameters are optional parameters such as UDF (user defined fields), static hashes, etc. More details on static hash generation and passing are mentioned in the hash generation section.

Last updated