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
Java
Kotlin
1
PayUPaymentParams.Builder builder = new PayUPaymentParams.Builder();
2
builder.setAmount(<String>)
3
.setIsProduction(<Boolean>)
4
.setProductInfo(<String>)
5
.setKey(<String>)
6
.setPhone(<String>)
7
.setTransactionId(<String>)
8
.setFirstName(<String>)
9
.setEmail(<String>)
10
.setSurl(<String>)
11
.setFurl(<String>)
12
.setUserCredential(<String>)
13
.setAdditionalParams(<HashMap<String,Object>>); //Optional, can contain any additional PG params
14
PayUPaymentParams payUPaymentParams = builder.build();
Copied!
1
val payUPaymentParams = PayUPaymentParams.Builder()
2
.setAmount(<String>)
3
.setIsProduction(<Boolean>)
4
.setKey(<String>)
5
.setProductInfo(<String>)
6
.setPhone(<String>)
7
.setTransactionId(<String>)
8
.setFirstName(<String>)
9
.setEmail(<String>)
10
.setSurl(<String>)
11
.setFurl(<String>)
12
.setUserCredential(<String>)
13
.setAdditionalParams(<HashMap<String,Any?>>) //Optional, can contain any additional PG params
14
.build()
Copied!

For Recurring Payments(SI)

If you are integrating SI, then generate below payment params additionally
Java
Kotlin
1
PayUSIParams siDetails = new PayUSIParams.Builder()
2
.setIsFreeTrial(true) //set it to true for free trial. Default value is false
3
.setBillingAmount("1.0")
4
.setBillingCycle(PayUBillingCycle.ONCE)
5
.setBillingCurrency("INR")
6
.setBillingInterval(1)
7
.setPaymentStartDate("2021-12-24")
8
.setPaymentEndDate("2021-12-31")
9
.setBillingRule(PayuBillingRule.MAX)
10
.setBillingLimit(PayuBillingLimit.ON)
11
.setRemarks("SI Txn")
12
.build();
Copied!
1
val siDetails = PayUSIParams.Builder()
2
.setIsFreeTrial(true) //set it to true for free trial. Default value is false
3
.setBillingAmount("1.0")
4
.setBillingCycle(PayUBillingCycle.ONCE)
5
.setBillingCurrency("INR")
6
.setBillingInterval(1)
7
.setPaymentStartDate("2021-12-24")
8
.setPaymentEndDate("2021-12-31")
9
.setBillingRule(PayuBillingRule.MAX)
10
.setBillingLimit(PayuBillingLimit.ON)
11
.setRemarks("SI Txn")
12
.build()
Copied!
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
Java
Kotlin
1
PayUPaymentParams.Builder builder = new PayUPaymentParams.Builder();
2
builder.setAmount(<String>)
3
.setIsProduction(<Boolean>)
4
.setProductInfo(<String>)
5
.setKey(<String>)
6
.setPhone(<String>)
7
.setTransactionId(<String>)
8
.setFirstName(<String>)
9
.setEmail(<String>)
10
.setSurl(<String>)
11
.setFurl(<String>)
12
.setUserCredential(<String>)
13
.setAdditionalParams(<HashMap<String,Object>>); //Optional, can contain any additional PG params
14
.setPayUSIParams(siDetails);
15
PayUPaymentParams payUPaymentParams = builder.build();
Copied!
1
val payUPaymentParams = PayUPaymentParams.Builder()
2
.setAmount(<String>)
3
.setIsProduction(<Boolean>)
4
.setKey(<String>)
5
.setProductInfo(<String>)
6
.setPhone(<String>)
7
.setTransactionId(<String>)
8
.setFirstName(<String>)
9
.setEmail(<String>)
10
.setSurl(<String>)
11
.setFurl(<String>)
12
.setUserCredential(<String>)
13
.setAdditionalParams(<HashMap<String,Any?>>) //Optional, can contain any additional PG params
14
.setPayUSIParams(siDetails)
15
.build()
Copied!

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 modified 2mo ago