Advanced Integration

Customize your integration

Change theme

You can change the primary and the secondary color of the UI to match your apps theme

Swift
Objective-C
Swift
let config = PayUCheckoutProConfig()
config.customiseUI(primaryColor: <#UIColor#>, secondaryColor: <#UIColor#>)
Objective-C
PayUCheckoutProConfig *config = [PayUCheckoutProConfig new];
[config customiseUIWithPrimaryColor:[UIColor blueColor] secondaryColor:[UIColor whiteColor]];

Set Merchant Name & Logo

You can customise the name and logo to personalise the checkout screen

Swift
Objective-C
Swift
let config = PayUCheckoutProConfig()
config.merchantName = <#T##String?#>
config.merchantLogo = <#T##UIImage?#>
Objective-C
PayUCheckoutProConfig *config = [PayUCheckoutProConfig new];
config.merchantName = <#(NSString * _Nullable)#>;
config.merchantLogo = <#(NSString * _Nullable)#>;

Hide Checkout screen back button dialog

Merchant can choose to hide dialog that appears when back button is pressed from L1 screen. Default value is true.

Swift
Objective-C
Swift
let config = PayUCheckoutProConfig()
config.showExitConfirmationOnCheckoutScreen = <#Bool#>
Objective-C
PayUCheckoutProConfig *config = [PayUCheckoutProConfig new];
config.showExitConfirmationOnCheckoutScreen = <#(BOOL)#>;

Hide back button dialog after payment initialisation

Merchant can choose to hide dialog that appears when back button is pressed after payment is initialised. Default value is true.

Swift
Objective-C
Swift
let config = PayUCheckoutProConfig()
config.showExitConfirmationOnPaymentScreen = <#Bool#>
Objective-C
PayUCheckoutProConfig *config = [PayUCheckoutProConfig new];
config.showExitConfirmationOnPaymentScreen = <#(BOOL)#>;

Set 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 a longer to load then by default PayU has response timeout of 5 sec. However, if merchant feel that their surl/furl can take longer than 5 seconds then they can set this flag.

Swift
Objective-C
Swift
let config = PayUCheckoutProConfig()
config.merchantResponseTimeout = <#TimeInterval?#>
Objective-C
PayUCheckoutProConfig *config = [PayUCheckoutProConfig new];
config.merchantResponseTimeout = <#(NSTimeInterval * _Nullable)#>;

Enable surepay on bank page

Merchant can enable surepay on bank page. When internet is lost during the transaction, if transaction can be retry from that bank page after internet is resumed, surepay dialog is displayed. It has legitimate values as 0,1,2 and 3. Where number defines number of times surepay dialog should be displayed during the transaction for no internet connectivity. Default value is 0.

Swift
Objective-C
Swift
let config = PayUCheckoutProConfig()
config.surePayCount = <#UInt?#>
Objective-C
PayUCheckoutProConfig *config = [PayUCheckoutProConfig new];
config.surePayCount = <#(NSUInteger * _Nullable)#>;

Review Order

Merchant can pass the checkout order details to the SDK that will be displayed in the SDK during the transaction flow.

Swift
Objective-C
Swift
let config = PayUCheckoutProConfig()
config.cartDetails = [["Milk": "1L"],["Butter": "1Kg"]]
Objective-C
PayUCheckoutProConfig *config = [PayUCheckoutProConfig new];
config.cartDetails = @[@{@"Milk": @"1L"},@{@"Butter": @"1Kg"}];

Additional payment options in the Checkout screen

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

Swift
Objective-C
Swift
var preferredPaymentModes: [PaymentMode] = []
preferredPaymentModes.append(PaymentMode(paymentType: .upi, paymentOptionID: BankCodes.gPayUPI))
preferredPaymentModes.append(PaymentMode(paymentType: .wallet, paymentOptionID: BankCodes.phonePeWallet))
preferredPaymentModes.append(PaymentMode(paymentType: .wallet, paymentOptionID: BankCodes.paytmWallet))
let config = PayUCheckoutProConfig()
config.paymentModesOrder = preferredPaymentModes
Objective-C
NSMutableArray<PaymentMode *> *preferredPaymentModes = [NSMutableArray new];
[preferredPaymentModes addObject: [[PaymentMode alloc] initWithPaymentType:PaymentTypeUpi paymentOptionID:BankCodes.gPayUPI]];
[preferredPaymentModes addObject: [[PaymentMode alloc] initWithPaymentType:PaymentTypeWallet paymentOptionID:BankCodes.phonePeWallet]];
[preferredPaymentModes addObject: [[PaymentMode alloc] initWithPaymentType:PaymentTypeWallet paymentOptionID:BankCodes.paytmWallet]];
PayUCheckoutProConfig *config = [PayUCheckoutProConfig new];
config.paymentModesOrder = preferredPaymentModes;

This will display Google Pay, PhonePe and Paytm respectively on top of available payment options. To reorder the all the payment options check the next section.

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, merchant need to provide list of payment modes. Checkout order will be the order of items in the list. If not all payment modes order is mentioned in list the other payment modes will be displayed in their default order as shown above.

Consider below example to order Cards and UPI on L1 screen

Swift
Objective-C
Swift
var preferredPaymentModes: [PaymentMode] = []
preferredPaymentModes.append(PaymentMode(paymentType: .ccdc))
preferredPaymentModes.append(PaymentMode(paymentType: .upi))
let config = PayUCheckoutProConfig()
config.paymentModesOrder = preferredPaymentModes
Objective-C
NSMutableArray<PaymentMode *> *preferredPaymentModes = [NSMutableArray new];
[preferredPaymentModes addObject: [[PaymentMode alloc] initWithPaymentType: PaymentTypeCcdc paymentOptionID: nil]];
[preferredPaymentModes addObject: [[PaymentMode alloc] initWithPaymentType: PaymentTypeUpi paymentOptionID: nil]];
PayUCheckoutProConfig *config = [PayUCheckoutProConfig new];
config.paymentModesOrder = preferredPaymentModes;

The resulting order on the initial Checkout screen will be:

Cards (credit/debit)

UPI

Net Banking

Wallets