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
},
"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
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
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
Last updated
Was this helpful?