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
1
{
2
"requestId":"1614595430980",
3
"transactionDetails":{
4
"amount":5000
5
},
6
"customerDetails": {
7
// optional
8
"mobile": "9999999999", // optional
9
},
10
"useCase":{
11
"getAdditionalCharges":true,
12
"getTaxSpecification":true,
13
"checkDownStatus":true,
14
"getExtendedPaymentDetails":true,
15
"getOfferDetails":true
16
}
17
}
Copied!
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
1
Usecase.Builder usecase = new Usecase.Builder()
2
.setCheckCustomerEligibility(true)
3
.shouldCheckDownStatus(true) // set it to true to fetch bank down status for each payment option
4
.shouldGetAdditionalCharges(true) // set it to true to fetch additional charges applicable on each payment option
5
.shouldGetOfferDetails(true) // set it to true to fetch offers enabled on merchant key
6
.shouldGetExtendedPaymentDetails(true) // set it to true to get extended payment details
7
.shouldGetTaxSpecification(true) // set it to true to fetch tax info applicable on each payment mode
8
.build();
9
10
GetTransactionDetails.Builder transactionDetails = new GetTransactionDetails.Builder()
11
.setAmount(1000.0)//transaction amount in double
12
.build();
13
14
//Passing Customer Details is optional and can be used
15
//to check EMI eligibility based on mobile number
16
CustomerDetails.Builder customerDetails = new CustomerDetails.Builder()
17
.setMobile("9999999999") //pass the mobile number if want to get eligibility status in payment option
18
.build()
19
20
String var1 = new GetCheckoutDetailsRequest.Builder()
21
.setUsecase(usecase)
22
.setCustomerDetails(customerDetails)
23
.setTransactionDetails(transactionDetails)
24
.build().prepareJSON();
Copied!
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
1
//if netbanking is available on merchant key
2
if(payuResponse.isNetBanksAvailable()){
3
ArrayList<PaymentDetails> = payuResponse.getNetbanks();
4
}
Copied!
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
1
if(payuResponse.isTaxSpecificationAvailable())
2
TaxSpecification taxSpecification = payuResponse.getTaxSpecification();
3
4
taxSpecification.getCcTaxValue() //tax applicable on CC transactions
5
taxSpecification.getDcTaxValue() //tax applicable on DC transactions
6
taxSpecification.getNbTaxValue() //tax applicable on NB transactions
7
taxSpecification.getCashTaxValue() //tax applicable on Wallet transactions
8
...
Copied!
Last modified 3mo ago