GetCheckoutDetails API

As mentioned in table, 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
},
"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

String var1 = new GetCheckoutDetailsRequestBuilder()
.shouldGetAdditionalCharges(true) // set it to true to fetch additional charges applicable on each payment option
.shouldGetTaxSpecification(true) // set it to true to fetch tax info applicable on each payment mode
.shouldCheckDownStatus(true) // set it to true to fetch bank down status for 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
.setAmount(<double>).build(); //transaction amount

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

Getting API response

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

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
...