SDK Configuration
To configure the CheckoutPro SDK, you can customize the properties in the PayUCheckoutProConfig and pass the config object in the open method when invoking the SDK like below
Java
Kotlin
1
PayUCheckoutPro.open(
2
Activity activity,
3
PayUPaymentParams payUPaymentParams,
4
PayUCheckoutProConfig payUCheckoutProConfig,
5
PayUCheckoutProListener payUCheckoutProListener)
Copied!
1
PayUCheckoutPro.open(
2
activity: Activity,
3
payUPaymentParams: PayUPaymentParams,
4
payUCheckoutProConfig: PayUCheckoutProConfig,
5
payUCheckoutProListener: PayUCheckoutProListener)
Copied!

Merchant Name

The merchant name is displayed in the SDK indicating the recipient of the payment. Max length is 20 characters. To set your brand name or business name, set the merchantName property of the PayUCheckoutProConfig object as indicated below-
Java
Kotlin
1
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
2
payUCheckoutProConfig.setMerchantName("PayU");
Copied!
1
val payUCheckoutProConfig = PayUCheckoutProConfig()
2
payUCheckoutProConfig.merchantName = "PayU Payments Private Limited"
Copied!
You can display an image (typically, your brand logo) in the PayUCheckoutPro SDK to reinforce trust and display your brand to your customer. To set a logo in the SDK, you need to pass the drawable id of the logo image resource from your app.
Java
Kotlin
1
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
2
payUCheckoutProConfig.setMerchantLogo(R.drawable.merchant_logo);
Copied!
1
val payUCheckoutProConfig = PayUCheckoutProConfig()
2
payUCheckoutProConfig.merchantLogo = R.drawable.merchant_logo
Copied!

Hide toolbar in the Custom Browser (CB)

Merchant can choose to hide the toolbar on CB. By default,toolbar is displayed.
Java
Kotlin
1
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig ();
2
payUCheckoutProConfig.setShowCbToolbar(false); //hide toolbar
Copied!
1
val payUCheckoutProConfig = PayUCheckoutProConfig()
2
payUCheckoutProConfig.showCbToolbar = false //hide toolbar
Copied!

Hide Checkout screen back button dialog

Merchant can choose to hide dialog that appears when the back button is pressed from the L1 screen. Default value is true.
Java
Kotlin
1
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig ();
2
payUCheckoutProConfig.setShowExitConfirmationOnCheckoutScreen(false); //hide back button dialog
Copied!
1
val payUCheckoutProConfig = PayUCheckoutProConfig ()
2
payUCheckoutProConfig.showExitConfirmationOnCheckoutScreen = false//hide back button dialog
Copied!

Hide CB back button dialog

Merchant can choose to hide dialog that appears when back button is pressed in CB. Default value is true.
Java
Kotlin
1
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
2
payUCheckoutProConfig.setShowExitConfirmationOnPaymentScreen(false); //hide back button dialog
Copied!
1
val payUCheckoutProConfig = PayUCheckoutProConfig ()
2
payUCheckoutProConfig.showExitConfirmationOnPaymentScreen= false //hide back button dialog
Copied!

Runtime SMS Permission

Merchant can set this flag to false if doesn’t want Checkout Pro SDK to ask for runtime SMS permission on bank otp page. Default value is true.
Java
Kotlin
1
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
2
payUCheckoutProConfig.setMerchantSmsPermission(false);
Copied!
1
val payUCheckoutProConfig = PayUCheckoutProConfig()
2
payUCheckoutProConfig.merchantSmsPermission= false
Copied!

Auto Select OTP

Merchant can choose to auto select OTP flow on bank page with below flag. Default value is false.
Java
Kotlin
1
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
2
payUCheckoutProConfig.setAutoApprove(true);
Copied!
1
val payUCheckoutProConfig = PayUCheckoutProConfig ()
2
payUCheckoutProConfig.autoSelectOtp = true
Copied!

Merchant Response Timeout

This is time PayU will wait for merchant surl/furl to load before passing the transaction response back to the app. If merchant surl/furl pages take longer to load then by default PayU has a response timeout of 10 sec. However, if merchants feel that their Surl/Furl can take longer than 10 seconds then they can set this flag.
Java
Kotlin
1
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
2
payUCheckoutProConfig.setMerchantResponseTimeout(15000); // for 15 seconds timeout
Copied!
1
val payUCheckoutProConfig = PayUCheckoutProConfig()
2
payUCheckoutProConfig.merchantResponseTimeout = 15000 // for 15 seconds timeout
Copied!

Waiting for OTP timeout

We wait for a specifed time for the OTP after which the SDK falls back to the manual OTP screen. The default time is 30s; you may change it to any other duration. We recommend keeping it less than 60s for better user experience.
Waiting For OTP
Java
Kotlin
1
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
2
payUCheckoutProConfig.setWaitingTime(45000);
Copied!
1
PayUCheckoutProConfig payUCheckoutProConfig = PayUCheckoutProConfig()
2
payUCheckoutProConfig.waitingTime = 45000
Copied!

Enable Surepay on Bank Page

Merchant can enable surepay on the bank page. When the internet is lost during the transaction, if the transaction can be retry from that bank page after the internet is resumed, surepay dialog is displayed. It has legitimate values as 0,1,2 and 3. Where number defines the number of times surepay dialog should be displayed during the transaction for no internet connectivity. The Default value is 0.
Java
Kotlin
1
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
2
payUCheckoutProConfig.setSurePayCount(3);
Copied!
1
val payUCheckoutProConfig = PayUCheckoutProConfig ()
2
payUCheckoutProConfig.surePayCount = 3
Copied!

Review Order

Merchant can pass the checkout order details to the SDK that will be displayed in the SDK during the transaction flow.
Java
Kotlin
1
ArrayList<OrderDetails> orderDetailsList = new ArrayList<>();
2
orderDetailsList.add(new OrderDetails("Milk","1"));
3
orderDetailsList.add(new OrderDetails("Butter","1"));
4
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig ();
5
payUCheckoutProConfig.setCartDetails(orderDetailsList);
Copied!
1
val orderDetailsList = ArrayList<OrderDetails>()
2
orderDetailsList.add(OrderDetails(“Milk”,”1”))
3
orderDetailsList.add(OrderDetails(“Butter”,”1”))
4
val payUCheckoutProConfig = PayUCheckoutProConfig ()
5
payUCheckoutProConfig.cartDetails = orderDetailsList
Copied!

Additional Payment Options in the Checkout screen

Consider the below example to display Google Pay, PhonePe, and Paytm on the primary checkout screen.
Java
Kotlin
1
ArrayList<PaymentMode> checkoutOrderList = new ArrayList<>();
2
checkoutOrderList.add(new PaymentMode(PaymentType.UPI, PayUCheckoutProConstants.CP_GOOGLE_PAY));
3
checkoutOrderList.add(new PaymentMode(PaymentType.WALLET, PayUCheckoutProConstants.CP_PHONEPE));
4
checkoutOrderList.add(new PaymentMode(PaymentType.WALLET, PayUCheckoutProConstants.CP_PAYTM));
5
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig ();
6
payUCheckoutProConfig.setPaymentModesOrder(checkoutOrderList);
Copied!
1
val checkoutOrderList = ArrayList<PaymentMode>()
2
checkoutOrderList.add(PaymentMode(PaymentType.UPI, PayUCheckoutProConstants.CP_GOOGLE_PAY))
3
checkoutOrderList.add(PaymentMode(PaymentType.WALLET, PayUCheckoutProConstants.CP_PHONEPE))
4
checkoutOrderList.add(PaymentMode(PaymentType.WALLET, PayUCheckoutProConstants.CP_PAYTM))
5
val payUCheckoutProConfig = PayUCheckoutProConfig ()
6
payUCheckoutProConfig.paymentModesOrder = checkoutOrderList
Copied!

Set Checkout Payment modes order

Default payment modes order on checkout screen is as below: Card, NetBanking, UPI and Wallets
Merchant can specify the checkout payment options order. For this, the merchant needs to provide a list of payment modes. Checkout order will be the order of items in the list. If not all payment modes order is mentioned in the list the other payment modes will be displayed in their default order as shown above.
Java
Kotlin
1
ArrayList<PaymentMode> checkoutOrderList = new ArrayList<>();
2
checkoutOrderList.add(new PaymentMode(PaymentType.CARD));
3
checkoutOrderList.add(new PaymentMode(PaymentType.UPI));
4
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig ();
5
payUCheckoutProConfig.setPaymentModesOrder (checkoutOrderList);
Copied!
1
val checkoutOrderList = ArrayList<PaymentMode>()
2
checkoutOrderList.add(PaymentMode(PaymentType.CARD))
3
checkoutOrderList.add(PaymentMode(PaymentType.UPI))
4
val payUCheckoutProConfig = PayUCheckoutProConfig ()
5
payUCheckoutProConfig.paymentModesOrder = checkoutOrderList
Copied!
The resulting order on the initial Checkout screen will be
Cards (credit/debit)
UPI
Net Banking
Wallets

Enforce Payment Modes

You can directly open a specific payment mode like NB, WALLET, UPI,CARD, etc in SDK. To do so, create a enforce list as below
Java
Kotlin
1
ArrayList<HashMap<String,String>> enforceList = new ArrayList();
2
HashMap<String,String> map = new HashMap<>();
3
map.put(PayUCheckoutProConstants.CP_PAYMENT_TYPE, PaymentType.NB.name());
4
enforceList.add(map);
Copied!
1
val enforceList = ArrayList<HashMap<String,String>>()
2
enforceList.add(HashMap<String,String>().apply {
3
put(PayUCheckoutProConstants.CP_PAYMENT_TYPE,PaymentType.NB.name)
4
})
Copied!
To enforce card type as well like CC or DC, then enforce list should have a HashMap with keys PaymentType and CardType as shown below
Java
Kotlin
1
ArrayList<HashMap<String,String>> enforceList = new ArrayList();
2
HashMap<String,String> map = new HashMap<>();
3
map.put(PayUCheckoutProConstants.CP_PAYMENT_TYPE, PaymentType.CARD.name());
4
map.put(PayUCheckoutProConstants.CP_CARD_TYPE, CardType.CC.name());
5
enforceList.add(map);
Copied!
1
val enforceList = ArrayList<HashMap<String,String>>()
2
enforceList.add(HashMap<String,String>().apply {
3
put(PayUCheckoutProConstants.CP_PAYMENT_TYPE,PaymentType.CARD.name) put(PayUCheckoutProConstants.CP_CARD_TYPE,CardType.CC.name)
4
})
Copied!
After creating the enforce list, pass it to payuCheckoutProConfig object created above
Java
Kotlin
1
payUCheckoutProConfig.setEnforcePaymentList(enforceList);
Copied!
1
payUCheckoutProConfig.enforcePaymentList = enforceList
Copied!
Last modified 2d ago