Merchant Web Services

This page describes how to make api calls from SDK.

Initialise MerchantWebService.

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>); // Command for fetching payment related details
merchantWebService.setVar1(userCredential) // User Credential of the merchant
merchantWebService.setHash(<Api Command Hash>) //Hash for fetching payment related details such as payment options

For web service hash generation visit Hash Generation.

Create Merchant Web Service PostData.

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

If PostData has no error - you are good to go else please check the data point set in merchantWebService

Apis Commands supported

Below api commands are present in PayUConstants class.

Commands

Description

​Task

Listner

PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK

To get all enabled payment options

GetPaymentRelatedDetailsTask payuTask = GetPaymentRelatedDetailsTask(this); payuTask.execute(payuConfig);

PaymentRelatedDetailsListener

VAS_FOR_MOBILE_SDK

To get health status of payment options

ValueAddedServiceTask payuTask = ValueAddedServiceTask(this); payuTask.execute(payuConfig);

ValueAddedServiceApiListener

SAVE_USER_CARD

Save User CC/DC

SaveCardTask payuTask = SaveCardTask(this); payuTask.execute(payuConfig);

SaveCardApiListener

EDIT_USER_CARD

Edit stored user card

EditCardTask payuTask = EditCardTask(this); payuTask.execute(payuConfig);

EditCardApiListener

DELETE_USER_CARD

Delete stored user card

DeleteCardTask payuTask = DeleteCardTask(this); payuTask.execute(payuConfig);

DeleteCardApiListener

GET_USER_CARDS

Get stored user cards

GetStoredCardTask payuTask = GetStoredCardTask(this); payuTask.execute(payuConfig);

GetStoredCardApiListener

CHECK_IS_DOMESTIC

Get Bin information of CC/DC

GetCardInformationTask payuTask = GetCardInformationTask(this); payuTask.execute(payuConfig);

GetCardInformationApiListener

GET_TRANSACTION_INFO

Getting Transaction information

GetTransactionInfoTask payuTask = GetTransactionInfoTask(this); payuTask.execute(payuConfig);

GetTransactionInfoApiListener

VERIFY_PAYMENT

Verify Payment Status

VerifyPaymentTask payuTask = VerifyPaymentTask(this); payuTask.execute(payuConfig);

VerifyPaymentApiListener

CHECK_OFFER_DETAILS

To get the offer details.

CheckOfferDetailsTask payuTask = CheckOfferDetailsTask(this); payuTask.execute(payuConfig);

CheckOfferDetailsApiListener

API_GET_EMI_AMOUNT_ACCORDING_INTEREST

To get the emi amount according to interest.

GetEmiAmountAccordingToInterestTask payuTask = GetEmiAmountAccordingToInterestTask(this); payuTask.execute(payuConfig);

GetEmiAmountAccordingToInterestApiListener

CHECK_OFFER_STATUS

To check the status of offe

GetOfferStatusTask payuTask = GetOfferStatusTask(this); payuTask.execute(payuConfig);

GetOfferStatusApiListener

ELIGIBLE_BINS_FOR_EMI

To check if bin is eligible for EMI

EligibleBinsForEMITask payuTask = EligibleBinsForEMITask(this); payuTask.execute(payuConfig);

EligibleBinsForEMIApiListener

GET_CHECKOUT_DETAILS

To get info about additional charges, bank down, tax info and offers

GetCheckoutDetailsTask getCheckoutDetailsTask = GetCheckoutDetailsTask(this); getCheckoutDetailsTask.execute(payuConfig);

CheckoutDetailsListener