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
Java
PayUCheckoutPro.open(
Activity activity,
PayUPaymentParams payUPaymentParams,
PayUCheckoutProConfig payUCheckoutProConfig,
PayUCheckoutProListener payUCheckoutProListener)
Kotlin
PayUCheckoutPro.open(
activity: Activity,
payUPaymentParams: PayUPaymentParams,
payUCheckoutProConfig: PayUCheckoutProConfig,
payUCheckoutProListener: PayUCheckoutProListener)

Merchant Name

The merchant name is displayed in the SDK indicating the recipient of the payment. To set your brand name or business name, set the merchantName property of the PayUCheckoutProConfig object as indicated below

Java
Kotlin
Java
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setMerchantName(" PayU Payments Private Limited");
Kotlin
val payUCheckoutProConfig = PayUCheckoutProConfig()
payUCheckoutProConfig.merchantName = "PayU Payments Private Limited"

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
Java
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setMerchantLogo(R.drawable.merchant_logo);
Kotlin
val payUCheckoutProConfig = PayUCheckoutProConfig()
payUCheckoutProConfig.merchantLogo = R.drawable.merchant_logo

Hide toolbar in the Custom Browser (CB)

Merchant can choose to hide the toolbar on CB. By default,toolbar is displayed.

Java
Kotlin
Java
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig ();
payUCheckoutProConfig.setShowCbToolbar(false); //hide toolbar
Kotlin
val payUCheckoutProConfig = PayUCheckoutProConfig()
payUCheckoutProConfig.showCbToolbar = false //hide toolbar

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
Java
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig ();
payUCheckoutProConfig.setShowExitConfirmationOnCheckoutScreen(false); //hide back button dialog
Kotlin
val payUCheckoutProConfig = PayUCheckoutProConfig ()
payUCheckoutProConfig.showExitConfirmationOnCheckoutScreen = false//hide back button dialog

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
Java
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setShowExitConfirmationOnPaymentScreen(false); //hide back button dialog
Kotlin
val payUCheckoutProConfig = PayUCheckoutProConfig ()
payUCheckoutProConfig.showExitConfirmationOnPaymentScreen= false //hide back button dialog

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
Java
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setMerchantSmsPermission(false);
Kotlin
val payUCheckoutProConfig = PayUCheckoutProConfig()
payUCheckoutProConfig.merchantSmsPermission= false

Auto Select OTP

Merchant can choose to auto select OTP flow on bank page with below flag. Default value is false.

Java
Kotlin
Java
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setAutoApprove(true);
Kotlin
val payUCheckoutProConfig = PayUCheckoutProConfig ()
payUCheckoutProConfig.autoSelectOtp = true

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
Java
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setMerchantResponseTimeout(15000); // for 15 seconds timeout
Kotlin
val payUCheckoutProConfig = PayUCheckoutProConfig()
payUCheckoutProConfig.merchantResponseTimeout = 15000 // for 15 seconds timeout

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
Java
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setSurePayCount(3);
Kotlin
val payUCheckoutProConfig = PayUCheckoutProConfig ()
payUCheckoutProConfig.surePayCount = 3

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
Java
ArrayList<OrderDetails> orderDetailsList = new ArrayList<>();
orderDetailsList.add(new OrderDetails("Milk","1"));
orderDetailsList.add(new OrderDetails("Butter","1"));
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig ();
payUCheckoutProConfig.setCartDetails(orderDetailsList);
Kotlin
val orderDetailsList = ArrayList<OrderDetails>()
orderDetailsList.add(OrderDetails(“Milk”,”1”))
orderDetailsList.add(OrderDetails(“Butter”,”1”))
val payUCheckoutProConfig = PayUCheckoutProConfig ()
payUCheckoutProConfig.cartDetails = orderDetailsList

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
Java
ArrayList<PaymentMode> checkoutOrderList = new ArrayList<>();
checkoutOrderList.add(new PaymentMode(PaymentType.UPI, PayUCheckoutProConstants.CP_GOOGLE_PAY));
checkoutOrderList.add(new PaymentMode(PaymentType.WALLET, PayUCheckoutProConstants.CP_PHONEPE));
checkoutOrderList.add(new PaymentMode(PaymentType.WALLET, PayUCheckoutProConstants.CP_PAYTM));
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig ();
payUCheckoutProConfig.setPaymentModesOrder(checkoutOrderList);
Kotlin
val checkoutOrderList = ArrayList<PaymentMode>()
checkoutOrderList.add(PaymentMode(PaymentType.UPI, PayUCheckoutProConstants.CP_GOOGLE_PAY))
checkoutOrderList.add(PaymentMode(PaymentType.WALLET, PayUCheckoutProConstants.CP_PHONEPE))
checkoutOrderList.add(PaymentMode(PaymentType.WALLET, PayUCheckoutProConstants.CP_PAYTM))
val payUCheckoutProConfig = PayUCheckoutProConfig ()
payUCheckoutProConfig.paymentModesOrder = checkoutOrderList

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
Java
ArrayList<PaymentMode> checkoutOrderList = new ArrayList<>();
checkoutOrderList.add(new PaymentMode(PaymentType.CARD));
checkoutOrderList.add(new PaymentMode(PaymentType.UPI));
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig ();
payUCheckoutProConfig.setPaymentModesOrder (checkoutOrderList);
Kotlin
val checkoutOrderList = ArrayList<PaymentMode>()
checkoutOrderList.add(PaymentMode(PaymentType.CARD))
checkoutOrderList.add(PaymentMode(PaymentType.UPI))
val payUCheckoutProConfig = PayUCheckoutProConfig ()
payUCheckoutProConfig.paymentModesOrder = checkoutOrderList

The resulting order on the initial Checkout screen will be

Cards (credit/debit)

UPI

Net Banking

Wallets