Additional Params
(Optional Step)
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. Below is list of other parameters that can be passed in additional params.
Parameter
Type
Description
Mandatory
PayUCheckoutProConstants.CP_UDF1
String
User defined field, Merchant can store their customer id, etc
No
PayUCheckoutProConstants.CP_UDF2
String
User defined field, Merchant can store their customer id, etc
No
PayUCheckoutProConstants.CP_UDF3
String
User defined field, Merchant can store their customer id, etc
No
PayUCheckoutProConstants.CP_UDF4
String
User defined field, Merchant can store their customer id, etc
No
PayUCheckoutProConstants.CP_UDF5
String
User defined field, Merchant can store their customer id, etc
No
Static hashes
String
Covered in the Hash Generation section
No
Java
Kotlin
1
HashMap<String, Object> additionalParams = new HashMap<>();
2
additionalParams.put(PayUCheckoutProConstants.CP_UDF1, "udf1");
3
additionalParams.put(PayUCheckoutProConstants.CP_UDF2, "udf2");
4
additionalParams.put(PayUCheckoutProConstants.CP_UDF3, "udf3");
5
additionalParams.put(PayUCheckoutProConstants.CP_UDF4, "udf4");
6
additionalParams.put(PayUCheckoutProConstants.CP_UDF5, "udf5");
7
8
PayUPaymentParams.Builder builder = new PayUPaymentParams.Builder();
9
builder.setAmount("1.0")
10
.setIsProduction(true)
11
.setProductInfo("Macbook Pro")
12
.setKey(key)
13
.setPhone(phone)
14
.setTransactionId(String.valueOf(System.currentTimeMillis()))
15
.setFirstName("John")
16
.setEmail("[email protected]")
17
.setSurl("https://payuresponse.firebaseapp.com/success")
18
.setFurl("https://payuresponse.firebaseapp.com/failure")
19
.setUserCredential(key+":[email protected]")
20
.setAdditionalParams(additionalParams);
21
PayUPaymentParams payUPaymentParams = builder.build();
Copied!
1
val additionalParamsMap: HashMap<String, Any?> = HashMap()
2
additionalParamsMap[PayUCheckoutProConstants.CP_UDF1] = "udf1"
3
additionalParamsMap[PayUCheckoutProConstants.CP_UDF2] = "udf2"
4
additionalParamsMap[PayUCheckoutProConstants.CP_UDF3] = "udf3"
5
additionalParamsMap[PayUCheckoutProConstants.CP_UDF4] = "udf4"
6
additionalParamsMap[PayUCheckoutProConstants.CP_UDF5] = "udf5"
7
8
val payUPaymentParams = PayUPaymentParams.Builder()
9
.setAmount("1.0")
10
.setIsProduction(true)
11
.setKey(key)
12
.setProductInfo("Macbook Pro")
13
.setPhone(phone)
14
.setTransactionId(System.currentTimeMillis().toString())
15
.setFirstName("John")
16
.setEmail("[email protected]")
17
.setSurl(“https://payuresponse.firebaseapp.com/success”)
18
.setFurl("https://payuresponse.firebaseapp.com/failure ")
19
.setUserCredential("$key:[email protected]yopmail.com”)
20
.setAdditionalParams(additionalParamsMap)
21
.build()
Copied!
Last modified 6mo ago
Copy link