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
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-
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setMerchantName("PayU");
val payUCheckoutProConfig = PayUCheckoutProConfig()
payUCheckoutProConfig.merchantName = "PayU Payments Private Limited"
Merchant Logo
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.
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setMerchantLogo(R.drawable.merchant_logo);
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.
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig ();
payUCheckoutProConfig.setShowCbToolbar(false); //hide toolbar
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.
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig ();
payUCheckoutProConfig.setShowExitConfirmationOnCheckoutScreen(false); //hide back button dialog
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.
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setShowExitConfirmationOnPaymentScreen(false); //hide back button dialog
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.
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setMerchantSmsPermission(false);
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.
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setAutoApprove(true);
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.
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setMerchantResponseTimeout(15000); // for 15 seconds timeout
val payUCheckoutProConfig = PayUCheckoutProConfig()
payUCheckoutProConfig.merchantResponseTimeout = 15000 // for 15 seconds timeout
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.
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setWaitingTime(45000);
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.
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig();
payUCheckoutProConfig.setSurePayCount(3);
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.
ArrayList<OrderDetails> orderDetailsList = new ArrayList<>();
orderDetailsList.add(new OrderDetails("Milk","1"));
orderDetailsList.add(new OrderDetails("Butter","1"));
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig ();
payUCheckoutProConfig.setCartDetails(orderDetailsList);
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.
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.
ArrayList<PaymentMode> checkoutOrderList = new ArrayList<>();
checkoutOrderList.add(new PaymentMode(PaymentType.CARD));
checkoutOrderList.add(new PaymentMode(PaymentType.UPI));
PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig ();
payUCheckoutProConfig.setPaymentModesOrder (checkoutOrderList);
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
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
ArrayList<HashMap<String,String>> enforceList = new ArrayList();
HashMap<String,String> map = new HashMap<>();
map.put(PayUCheckoutProConstants.CP_PAYMENT_TYPE, PaymentType.NB.name());
map.put(PayUCheckoutProConstants.ENFORCED_IBIBOCODE, "AXIB");
enforceList.add(map);
val enforceList = ArrayList<HashMap<String,String>>()
enforceList.add(HashMap<String,String>().apply {
put(PayUCheckoutProConstants.CP_PAYMENT_TYPE,PaymentType.NB.name)
put(PayUCheckoutProConstants.ENFORCED_IBIBOCODE,"AXIB")
})
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
ArrayList<HashMap<String,String>> enforceList = new ArrayList();
HashMap<String,String> map = new HashMap<>();
map.put(PayUCheckoutProConstants.CP_PAYMENT_TYPE, PaymentType.CARD.name());
map.put(PayUCheckoutProConstants.CP_CARD_TYPE, CardType.CC.name());
map.put(PayUCheckoutProConstants.CP_CARD_SCHEME, CardScheme.MAST.name())
enforceList.add(map);