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
Java
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();
Kotlin
val payUPaymentParams = PayUPaymentParams.Builder()
.setAmount(<String>)
.setIsProduction(<Boolean>)
.setKey(<String>)
.setProductInfo(<String>)
.setPhone(<String>)
.setTransactionId(<String>)
.setFirstName(<String>)
.setEmail(<String>)
.setSurl(<String>)
.setFurl(<String>)
.setUserCredential(<String>)
.setAdditionalParams(<HashMap<String,Any?>>) //Optional, can contain any additional PG params
.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

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.