Custom Note Integration

(Optional steps)

Follow this section if you want to integrate Custom Note in PayUCheckoutPro SDK

Create Custom Note List

Create a list of custom Note that you want to pass to the CheckoutPro SDK. For each custom note , custom_note and custom_note_category needs to be passed.

  // for specific custom_note_category
  
  ArrayList<CustomNote> customNote = new ArrayList<>();
        ArrayList<PaymentType> noteCategory1 = new ArrayList<>();
        noteCategory1.add(PaymentType.CARD);
        CustomNote customNote1 = new CustomNote("Please welcome note", noteCategory1);
        customNote1.setCustom_note("Please welcome note");
        customNote1.setCustom_note_category(noteCategory1);
        
        ArrayList<PaymentType> noteCategory2 = new ArrayList<>();
        noteCategory2.add(PaymentType.CARD);
        CustomNote customNote2 = new CustomNote("Please welcome note", noteCategory1);
        customNote2.setCustom_note("Please welcome note");
        customNote2.setCustom_note_category(noteCategory2);
        customNote.add( customNote1);
        customNote.add( customNote2); 
        
        // when want to pass same custom note for multiple custom_note_category

        ArrayList<CustomNote> customNote = new ArrayList<>();
        ArrayList<PaymentType> noteCategory1 = new ArrayList<>();
        noteCategory1.add(PaymentType.CARD);
         noteCategory1.add(PaymentType.NB);
         noteCategory1.add(PaymentType.UPI);
        CustomNote customNote1 = new CustomNote("Please welcome note", noteCategory1);
        customNote1.setCustom_note("Please welcome note");
        customNote1.setCustom_note_category(noteCategory1);
        customNote.add( customNote1);
        
        // if do not want to pass any custom_note_category
        ArrayList<CustomNote> customNote = new ArrayList<>();
        CustomNote customNote1 = new CustomNote("Please welcome note", null);
        customNote1.setCustom_note("Please welcome note");
        customNote1.setCustom_note_category(null);
        

Pass custom Note List to SDK

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

PayUCheckoutProConfig checkoutProConfig = new PayUCheckoutProConfig();
checkoutProConfig.setCustomNoteDetails(customNote);

This checkoutProConfig object should be passed in PayUCheckoutPro.open() method as mentioned here

Last updated