SDK Integration
  • Getting Started
  • Onboarding Requirements
  • Hash Generation
  • Test Merchant list
  • Android
    • Android SDK Offering
    • PayUCheckoutPro
      • Integration
      • Build the Payment Params
        • Additional Params
      • Hash Generation
      • Set up the payment hashes
      • Initiate the Payment
      • Customized Integration
        • Set Webview Properties
        • SDK Configuration
        • Additional Offerings
      • Offers Integration
      • Convenience Fee Integration
      • Custom Note Integration
      • MCP Integration
    • Core
      • Supported Payment Types
      • TPV Integration
      • Merchant Web Services
        • Getting Enabled Payment Options
        • GetCheckoutDetails API
        • Lookup API
    • Custom Browser
      • Integration
        • CustomBrowser Config
        • CustomBrowserCallback
        • Supporting below Lollipop Versions
        • Third-Party Payments Support
      • Sample App
      • Change Logs
    • Native OTP Assist
      • Integration
      • Customization
      • Change Logs
    • UPI
      • Integration
      • TPV Integration in UPI
      • Sample App
      • Change Logs
    • Google Payâ„¢
      • Integration
      • Sample App
    • PhonePe
      • Integration
      • Sample App
      • Change Logs
    • OlaMoney
    • PayU OTP Parser
      • Integration
    • FAQ Android
  • iOS
    • PayUCheckoutPro
      • Integration
      • Advanced Integration
      • Set up the payment hashes
      • Convenience Fee Integration
      • MCP Integration
      • Custom Note Integration
    • Core
      • POD Integration
      • Seamless
      • Web Services
      • Objective C-Non-Seamless
      • Standing Instructions
      • TPV Integration
      • Sample App
    • Custom Browser
      • Sample App
    • OlaMoney
    • Native OTP Assist
      • Integration
      • Customization
    • UPI
      • Integration
      • Sample App
    • PayUParams
      • PayUSIParams
      • PayUBeneficiaryParams
  • Releasing to Apple
  • React-Native
    • PayUCheckoutPro
      • Integration
      • Set up the payment hashes
      • Advanced Integration
      • Change Logs
    • Core
    • Non-Seamless Wrapper
    • TPV (beta)
      • Integration
  • FAQ iOS
Powered by GitBook
On this page
  • Creating var1 for GetCheckoutDetails API
  • Getting API response

Was this helpful?

  1. Android
  2. Core
  3. Merchant Web Services

GetCheckoutDetails API

PreviousGetting Enabled Payment OptionsNextLookup API

Last updated 3 years ago

Was this helpful?

As mentioned in , it provides information of additionalCharges, bank down status , tax info and offers enabled on a merchant key. Calling this API is similar like other Web Services, the only difference is that it requires a JSON in var1 as below

{
   "requestId":"1614595430980",
   "transactionDetails":{
      "amount":5000
   },
    "customerDetails": {
      // optional
      "mobile": "9999999999", // optional
    },
   "useCase":{
      "getAdditionalCharges":true,
      "getTaxSpecification":true,
      "checkDownStatus":true,
      "getExtendedPaymentDetails":true,
      "getOfferDetails":true
   }
}

here, requestId is a random unique number passed in request

Creating var1 for GetCheckoutDetails API

SDK has a Utility class to create a JSON as above. Refer code below

  Usecase.Builder usecase = new Usecase.Builder()
  .setCheckCustomerEligibility(true)
  .shouldCheckDownStatus(true) // set it to true to fetch bank down status for each payment option 
  .shouldGetAdditionalCharges(true) // set it to true to fetch additional charges applicable on each payment option
  .shouldGetOfferDetails(true) // set it to true to fetch offers enabled on merchant key 
  .shouldGetExtendedPaymentDetails(true) // set it to true to get extended payment details
  .shouldGetTaxSpecification(true) // set it to true to fetch tax info applicable on each payment mode 
  .build();
  
  GetTransactionDetails.Builder transactionDetails = new GetTransactionDetails.Builder()
  .setAmount(1000.0)//transaction amount in double
  .build();
  
  //Passing Customer Details is optional and can be used 
  //to check EMI eligibility based on mobile number
  CustomerDetails.Builder customerDetails = new CustomerDetails.Builder()
  .setMobile("9999999999") //pass the mobile number if want to get eligibility status in payment option
  .build()
  
  String var1 = new GetCheckoutDetailsRequest.Builder()
            .setUsecase(usecase)
            .setCustomerDetails(customerDetails)
            .setTransactionDetails(transactionDetails)
            .build().prepareJSON();

Getting API response

Getting Additional Charges, Bank Down Status and Offers

Additional Charges are return in PaymentDetails object for each payment option. Refer below example for fetching Additional Charges for NetBanking

//if netbanking is available on merchant key
if(payuResponse.isNetBanksAvailable()){
ArrayList<PaymentDetails> = payuResponse.getNetbanks();
}

Additional Charge is available inside each PaymentDetails object and can be accessed using paymentDetails.getAdditionalCharge() method

In Similar way bank down is available inside each PaymentDetails object and can be accessed using paymentDetails.isBankDown() method

For Offers, An ArrayList<PayuOffer> is available inside each PaymentDetails object and to use it , paymentDetails.getOfferDetailsList()

Getting Tax Info

Tax is not applied on individual NetBanks or card schemes but instead applied on Payment Mode level like for all CC,DC, NB, Wallets, etc. So, to fetch the Tax Specification use below code

if(payuResponse.isTaxSpecificationAvailable())
TaxSpecification taxSpecification = payuResponse.getTaxSpecification();

taxSpecification.getCcTaxValue() //tax applicable on CC transactions
taxSpecification.getDcTaxValue() //tax applicable on DC transactions
taxSpecification.getNbTaxValue() //tax applicable on NB transactions
taxSpecification.getCashTaxValue() //tax applicable on Wallet transactions
...

After getting var1, pass that in Merchant Web Service with command as PayuConstants.GET_CHECKOUT_DETAILS . Follow the steps of making a Web Service call.

PayuResponse is received in onCheckoutDetailsResponse() callback method of CheckoutDetailsListener as mentioned in

table
here
table