Web Services for Core SDK

This page describes how to make api calls from SDK.

This section provides a reference for the following Web Service APIs for Android Core SDK. Before you integrate these APIs, you must follow Step 1 and Step 2 of this section.


Step 1: Initialise web service

Create an object of MerchantWebService with any of the supported API commands.

MerchantWebService merchantWebService = new MerchantWebService();
merchantWebService.setKey(merchantKey); // Merchant key
merchantWebService.setCommand(<Api Commands>); // Pass the command name
merchantWebService.setVar1(<Pass var 1 value>) // Pass the var1 calue
merchantWebService.setHash(<Api Command Hash>) // Pass the Hash value, and use the below formula

For more information on Web Service hash generation, refer to Generate Static Hash.

πŸ“˜

Generate Hash for MerchantWebService

To generate Hash refer to Hash Generation.

Formula :-sha512(key|command|var1|salt)

where

key= "Your Key"

command= <"Api Commands"> // Pass Command Name

var1= <"default"> // Pass the var1 value

salt= "Your SALT"

Step 2: Create Merchant web service PostData

PostData postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams();
if (postData.getCode() == PayuErrors.NO_ERROR) {
payuConfig.setData(postData.getResult());
}

πŸ“˜

Troubleshoot Postdata code errors

If the PostData code snippet (above) is returning errors, check the data point set in merchantWebService.

Commands

CommandsDescriptionTaskListener
PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDKTo get all enabled payment optionsGetPaymentRelatedDetailsTask payuTask = GetPaymentRelatedDetailsTask(this); payuTask.execute(payuConfig);PaymentRelatedDetailsListener
VAS_FOR_MOBILE_SDKTo get the health status of payment optionsValueAddedServiceTask payuTask = ValueAddedServiceTask(this); payuTask.execute(payuConfig);ValueAddedServiceApiListener
GET_BIN_INFOGet Bin information on CC/DCBinInfoTask binInfoTask = new BinInfoTask(this); binInfoTask.execute(payuConfig);GetCardInformationApiListener
CHECK_IS_DOMESTICGet Card information on CC/DCGetCardInformationTask payuTask = GetCardInformationTask(this); payuTask.execute(payuConfig);Β 
GET_TRANSACTION_INFOGetting Transaction informationGetTransactionInfoTask payuTask = GetTransactionInfoTask(this); payuTask.execute(payuConfig);GetTransactionInfoApiListener
VERIFY_PAYMENTVerify Payment StatusVerifyPaymentTask payuTask = VerifyPaymentTask(this); payuTask.execute(payuConfig);VerifyPaymentApiListener
CHECK_OFFER_DETAILSTo get the offer details.CheckOfferDetailsTask payuTask = CheckOfferDetailsTask(this); payuTask.execute(payuConfig);CheckOfferDetailsApiListener
API_GET_EMI_AMOUNT_ACCORDING_INTERESTTo get the EMI amount according to interest.GetEmiAmountAccordingToInterestTask payuTask = GetEmiAmountAccordingToInterestTask(this); payuTask.execute(payuConfig);GetEmiAmountAccordingToInterestApiListener
CHECK_OFFER_STATUSTo check the status of the offerGetOfferStatusTask payuTask = GetOfferStatusTask(this); payuTask.execute(payuConfig);GetOfferStatusApiListener
ELIGIBLE_BINS_FOR_EMITo check if the bin is eligible for EMIEligibleBinsForEMITask payuTask = EligibleBinsForEMITask(this); payuTask.execute(payuConfig);EligibleBinsForEMIApiListener
GET_CHECKOUT_DETAILSTo get info about additional charges, bank down, tax info, and offersGetCheckoutDetailsTask getCheckoutDetailsTask = GetCheckoutDetailsTask(this); getCheckoutDetailsTask.execute(payuConfig);CheckoutDetailsListener
GET_PAYMENT_INSTRUMENTTo get stored cards of the userGetTokenisedCardTask getTokenisedCardTask = GetTokenisedCardTask(this); getTokenisedCardTask.execute(payuConfig);GetTokenisedCardApiListener
DELETE_PAYMENT_INSTRUMENTTo delete the stored card of the userDeleteTokenisedCardTask deleteTokenisedCardTask = DeleteTokenisedCardTask(this); deleteTokenisedCardTask.execute(payuConfig);DeleteTokenisedCardApiListener
GET_PAYMENT_DETAILSTo get details of the stored card to make payment on another PGGetTokenisedCardDetailsTask getTokenisedCardDetailsTask = GetTokenisedCardDetailsTask(this); getTokenisedCardDetailsTask.execute(payuConfig);GetTokenisedCardDetailsApiListener
CHECK_BALANCETo get info about Sodexo saved CardCheckBalanceTask checkBalanceTask= CheckBalanceTask(this); checkBalanceTask.execute(payuConfig);CheckBalanceListener