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

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. 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"); 

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); 

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 

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 

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 

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);  

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);  

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 

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); 

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.

PayUCheckoutProConfig payUCheckoutProConfig = new PayUCheckoutProConfig(); 
payUCheckoutProConfig.setSurePayCount(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); 

Additional Payment Options in the Checkout screen

Consider the below example to display Google Pay, PhonePe, and Paytm on the primary checkout screen.

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);

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);  

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);

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);

After creating the enforce list, pass it to payuCheckoutProConfig object created above

payUCheckoutProConfig.setEnforcePaymentList(enforceList);

Last updated