Offers Integration

(Optional Step)

Follow this section if you want to integrate Offers in PayUCheckoutPro SDK

Create Offers List

Create a list of offers that you want to pass to the CheckoutPro SDK. For each offer in list, offer title, offer description, offer key and offer payment types need to be passed. On Checkout Page SDK will show the best offer applicable on that payment mode based on the offers list sent to the SDK. Below is an example code for offers list

 ArrayList<PayUOfferDetails> offerDetails = new ArrayList<>();
 PayUOfferDetails payUOfferDetails1 = new PayUOfferDetails();
 payUOfferDetails1.setOfferTitle("Instant discount of Rs.2");
 payUOfferDetails1.setOfferDescription("Get Instant dicount of Rs.2 on all Credit and Debit card transactions");

 ArrayList<PaymentType> offerPaymentTypes1 = new ArrayList<>();

 PayUOfferDetails payUOfferDetails2 = new PayUOfferDetails();
 payUOfferDetails2.setOfferTitle("Instant discount of Rs.2");
 payUOfferDetails2.setOfferDescription("Get Instant dicount of Rs.2 on all NetBanking transactions");

 ArrayList<PaymentType> offerPaymentTypes2 = new ArrayList<>();


Pass Offers List to SDK

To pass the Offers List created in above section to the SDK. Create a Object of PayUCheckoutProConfig and set Offers List as below

 PayUCheckoutProConfig checkoutProConfig = new PayUCheckoutProConfig();

This checkoutProConfig object should be passed in method as mentioned here

Last updated