To call any of the below API you need to create an object of class PayUWebServiceResponse and call the respective methods, you will get the result in completion handler of the method. If there is any error in the parameters passed by merchant then it will give the error in errorMessage string else you will get the parsed object.
This API will give payment option enabled for merchant and saved card.
To integrate this API call the method getPayUPaymentRelatedDetailForMobileSDK as below:
[webServiceResponse getPayUPaymentRelatedDetailForMobileSDK:self.paymentParamForPassing withCompletionBlock:^(PayUModelPaymentRelatedDetail *paymentRelatedDetails, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}else{
// It is good to go & paymentRelatedDetails is having the full detail of it
}
}];
Note:
paymentRelatedDetails.availablePaymentOptionsArray gives you all the available payment options for you.
paymentRelatedDetails.oneTapStoredCardArray, paymentRelatedDetails.storedCardArray, paymentRelatedDetails.netBankingArray, paymentRelatedDetails.cashCardArray, paymentRelatedDetails.EMIArray, paymentRelatedDetails.NoCostEMIArray gives available OneTapCard,StoredCard, NetBanking, CashCard, EMI and NoCostEMI
2 VAS
This API is used to get the list of down NetBanking and down cardbin
To integrate this API call the method callVASForMobileSDKWithPaymentParam as below
Now to check whether the particular NetBanking is down or not just pass the bankCode or cardbin (first 6 digit of cardnumber) to it and in completionBlock you will get the response as below
[webServiceResponse getVASStatusForCardBinOrBankCode:@"AXIB" withCompletionBlock:^(id ResponseMessage, NSString *errorMessage, id extraParam) {
if (errorMessage == nil) {
if (ResponseMessage == nil) {
// It means given NetBanking code or cardnumber is not down i.e. it is in good to go condition
}else{
NSString * responseMessage = [NSString new];
responseMessage = (NSString *) ResponseMessage;
// It means given NetBanking code or cardnumber is down and you can display the responseMessage if you want or you can customize it
}
}else{
// Something went wrong errorMessage is having the Detail
}
}];
To integrate this API call the method deleteStoredCard as below
[webServiceResponse deleteStoredCard:self.paymentParamForPassing withCompletionBlock:^(NSString *deleteStoredCardStatus, NSString *deleteStoredCardMessage, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
//It is good to go & deleteStoredCardMessage is having the full detail of it
}
}];
4 Get Offer Status
This API is helpful in checking whether offer is available for given cardNumber or not and if available then it will return the discount amount.
To integrate this API call the method getOfferStatus as below
[webServiceResponse getOfferStatus:self.paymentParamForPassing withCompletionBlock:^(PayUModelOfferStatus *offerStatus, NSString *errorMessage, id extraParam) {
if (errorMessage == nil) {
//It is good to go & offerStatus.discount contains the discounted amount if there is any offer & offerStatus.msg contains the message why offer is not available
}
else{
// Something went wrong errorMessage is having the Detail
}
}];
5 CheckOfferDetails:
This API is helpful in getting details of offerkey, whether the given offer key is valid or not. If we provide the amount to this API then this API gives the discount value also. We can use this API for payment mode such as CC/DC, StoreCard, OneTap Card and NetBanking To integrate this API call the method getOfferDetails
5.1 For CCDC:
Set the cardnumber in paymentParamForPassing object as below:
After setting cardNumber call the method getOfferDetails by passing second parameter as PAYMENT_PG_CCDC as below:
[webServiceResponse
getOfferDetails:self.paymentParamForPassing forPaymentType:PAYMENT_PG_CCDC withCompletionBlock:^(PayUModelOfferDetails *offerDetails, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
// offerDetails object is having the detail of the offer key
}
}];
5.2 For StoredCard/OneTapCard:
If merchant want to check offer for one particular storedcard then set the cardtoken as below:
Note: For StoredCard/OneTapCard, you must set userCredentials inside your payment params After setting cardToken call the method getOfferDetails by passing second parameter as PAYMENT_PG_STOREDCARD as below:
[webServiceResponse
getOfferDetails:self.paymentParamForPassing forPaymentType:PAYMENT_PG_STOREDCARD withCompletionBlock:^(PayUModelOfferDetails *offerDetails, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
// offerDetails object is having the detail of the offer key
}
}];
5.3 For NetBanking:
In case merchants want to know whether any particular Net Banking is eligible for offer then set the bankcode as below:
After setting bankcode call the method getOfferDetails by passing second parameter as PAYMENT_PG_NET_BANKING as below:
[webServiceResponse
getOfferDetails:self.paymentParamForPassing forPaymentType:PAYMENT_PG_NET_BANKING withCompletionBlock:^(PayUModelOfferDetails *offerDetails, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
// offerDetails object is having the detail of the offer key
}
}];
6 GetEMIAmountAccordingToInterest:
This API is helpful in getting details of all the available EMI’s. For this API, you need to set amount in the payment params as below:
To integrate this API call the method getEMIAmountAccordingToInterest as below
[webServiceResponse
getEMIAmountAccordingToInterest:self.paymentParamForPassing withCompletionBlock:^(NSDictionary *dictEMIDetails, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
// dictEMIDetails is having the EMI detail
}
}];
To integrate this API call the method getUserCards as below
[webServiceResponse
getUserCards:self.paymentParamForPassing withCompletionBlock:^(NSDictionary *dictStoredCard, NSString *errorMessage, id extraParam){
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
// dictStoredCard is having all the storedcard information
}
}];
8 Verify Payment:
This web-service is used to reconcile the transaction with PayU. When we post back the final response to you (merchant), we provide a list of parameters (including the status of the transaction – For example, success, failed etc). On a few occasions, the transaction response is initiated from our end, but it doesn’t reach you due to network issues or user activity (like refreshing the browser etc). We strongly recommend that this API is used to reconcile with PayU’s database once you receive the response. This will protect you from any tampering by the user and help in ensuring safe and secure transaction experience. For this API, you need to set transactionID inside your payment params as below:
Multiple txnID can be sent by using pipe Symbol(|) as seprator. To integrate this API call the method verifyPayment as below
[webServiceResponse
verifyPayment:self.paymentParamForPassing withCompletionBlock:^(NSDictionary *dictVerifyPayment, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
// dictVerifyPayment is having the verifyPayment detail
}
}];
9 Edit User Card (Deprecated):
This method is not supported because of RBI guidelines, in order to save or edit the card, please save card by authenticating it doing an actual payment.
This API is used to edit the details of an existing stored card in the vault. Only Card Name and Name on card can be edited. For this API, you need to set following parameter in the payment params as below:
To integrate this API call the method editUserCard as below
[webServiceResponse
editUserCard:self.paymentParamForPassing withCompletionBlock:^(PayUModelStoredCard *objStoredCard, NSString *errorMessage, id extraParam){
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
// objStoredCard object is having the updated stored card parameters
}
}];
10 Check Is Domestic:
This API is used to detect whether a particular bin number is international or domestic. It is also useful to determine the card’s issuing bank, the card type brand – i.e, Visa, Master etc and also the Card Category – i.e. Credit/Debit etc. Bin number is the first 6 digits of a Credit/Debit card. For this API, you need to set cardNumber in the payment params as below:
To integrate this API call the method checkIsDomestic as below
[webServiceResponse
checkIsDomestic:self.paymentParamForPassing withCompletionBlock:^(PayUModelCheckIsDomestic *checkIsDomestic, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
// checkIsDomestic object is having the required detail
}
}];
11 Get Transaction Info:
This API is used to extract the transaction details between two given time periods. The API takes the input as two dates along with time (initial and final), between which the transaction details are needed. The output would consist of the status of the API (success or failed) and all the transaction details in an array format. For this API, you need to set startTime and endTime in the payment params as below:
To integrate this API call the method getTransactionInfo as below
[webServiceResponse
getTransactionInfo:self.paymentParamForPassing withCompletionBlock:^(NSArray *arrOfGetTxnInfo, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
// arrOfGetTxnInfo is the array of PayUModelGetTxnInfo which is having detail of transaction
}
}];
12 Save User Card (Deprecated):
This method is not supported because of RBI guidelines, in order to save or edit the card, please save card by authenticating it doing an actual payment.
This API is used for saving a card to the vault. For this API, you need to set following parameter in the payment params as below:
self.paymentParamForPassing.userCredentials = @"gtKFFx:UmangArya";
self.paymentParamForPassing.cardName = @"UmangHDFC";
self.paymentParamForPassing.cardMode = @"CC";
self.paymentParamForPassing.cardType = @"MAST";
self.paymentParamForPassing.nameOnCard = @"testHDFC";
self.paymentParamForPassing.cardNo = @"5123456789012346";
self.paymentParamForPassing.expiryMonth = @"11";
self.paymentParamForPassing.expiryYear = @"2019";
self.paymentParamForPassing.duplicateCheck = @"1";// duplicateCheck = 1 means in response you will get duplicate count otherwise not
self.paymentParamForPassing.hashes.saveUserCardHash = @"hash";
To integrate this API call the method saveUserCard as below:
[webServiceResponse
saveUserCard:self.paymentParamForPassing withCompletionBlock:^(PayUModelStoredCard *objStoredCard, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
// objStoredCard is having the newly save card details
// objStoredCard.duplicateCardCount gives the number of duplicate card found for that merchant for this card
}
}];
13 GetBinInfo:
This API is used to detect whether a particular bin number is international or domestic. It is also useful to determine the card’s issuing bank, the card type brand – i.e, Visa, Master etc and also the Card Category – i.e. Credit/Debit etc. Bin number is the first 6 digits of a Credit/Debit card. This API is also helpful in knowing whether the cardbin is eligible for SI or not. For this API, you need to set cardNumber in the payment params as below
This API is used for saving a card to the vault. For this API, you need to set following parameter in the payment params as below:
self.paymentParamForPassing.cardNumber = @"512345";
// set below flag to true, to know whether the given cardBin support standing instructions
self.paymentParamForPassing.isSIInfo = TRUE;
self.paymentParamForPassing.hashes.getBinInfoHash = @"hash";
To integrate this API call the method saveUserCard as below:
[webServiceResponse
getBinInfo:self.paymentParamForPassing withCompletionBlock:^(NSArray<PayUModelCheckIsDomestic *> *allBin, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
// checkIsDomestic object is having the required detail
}
}];
14 GetCheckoutDetails API:
It provides information of additionalCharges, bank down status, tax info 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
here, requestId is a random unique number passed in request.
For this API you need to set amount, checkAdditionalCharges, checkDownStatus, checkTaxSpecification, checkCustomerEligibility, phoneNumber in the payment params as below:
self.paymentParamForPassing.checkAdditionalCharges=true;self.paymentParamForPassing.checkDownStatus=true;self.paymentParamForPassing.checkTaxSpecification=true;self.paymentParamForPassing.checkCustomerEligibility=true;self.paymentParam.phoneNumber= @"<Client's 10 digit Mobile Number>";self.paymentParamForPassing.amount= @"5000";self.paymentParamForPassing.hashes.getCheckoutDetailsHash= @"hash";
To integrate this API call the method getCheckoutDetail as below:
[webServiceResponse
getCheckoutDetail:self.paymentParamForPassing withCompletionBlock:^(NSArray<PayUModelPaymentRelatedDetail *> *paymentRelatedDetails, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
// paymentRelatedDetails object is having the required detail
}
}];
15 Lookup API:
This is used when integrating Multi-Currency Payments. Follow below steps to integrate this API:
Pre-requisites
Kindly connect with your Key Account Manager at PayU to get below credentials -
Merchant Access Key
Merchant Secret Key
Create Request
Lookup Api needs a JSON request. Product Type need to be passed either as DCC or MCP. DCC means Direct Currency Conversion, i.e it returns the conversion prices for card currency only. To get all enabled currencies on Merchant Access Key along with their conversion prices, use product type as MCP. For DCC, cardBin is mandatory, while for MCP cardBin is not required
Use MCP to get all enabled currency on Merchant Access Key or DCC to get direct currency conversion for card currency
Signature
Hmac SHA1 hash created with formula explained below
To calculate signature, Create HmacSHA1 hash of below data
Signature =HMAC-SHA1(data, key);
Data = baseCurrency+merchantOrderId+baseAmount
Key = Secret Key shared with the merchant at the time of on-boarding
Example data = INROBE-JU89-13151-11010000.00
To integrate this API call the method mcpLookup as below:
[webServiceResponse
mcpLookup:self.paymentParamForPassing withCompletionBlock:^(PayUModelMultiCurrencyPayment *paymentRelatedDetails, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
// PayUModelMultiCurrencyPayment object is having the required detail
}
}];
16 Check Sodexo Card Balance:
This can be used to fetch detail of Sodexo card with source id
To integrate this API call the method fetchSodexoCardDetails as below:
[webServiceResponse
fetchSodexoCardDetails.paymentParamForPassing withCompletionBlock:^(PayUModelSodexoCardDetail *sodexoCardDetail, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
// sodexoCardDetail object is having the required detail
}
}];
To integrate this API call the method getTokenizedPaymentDetails as below
[webServiceResponse getTokenizedPaymentDetails.paymentParamForPassing withCompletionBlock:^(PayUModelTokenizedPaymentDetails *tokenizedPaymentdetails,NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
//It is good to go & deleteStoredCardMessage is having the full detail of it
}
}];
18 Get Tokenised StoredCards:
This API is helpful in getting all the Stored Card for particular user. For this API, you need to set userCredentials in the payment params as below:
To integrate this API call the method getTokenizedStoredCards as below
[webServiceResponse getTokenizedStoredCards:self.paymentParamForPassing withCompletionBlock:^(NSDictionary *dictStoredCard,NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
//It is good to go & deleteStoredCardMessage is having the full detail of it
}
}];
To integrate this API call the method deleteTokenizedStoredCard as below
[webServiceResponse deleteTokenizedStoredCard:self.paymentParamForPassing withCompletionBlock:^(NSString *deleteStoredCardStatus, NSString *deleteStoredCardMessage, NSString *errorMessage, id extraParam) {
if (errorMessage) {
// Something went wrong errorMessage is having the Detail
}
else{
//It is good to go & deleteStoredCardMessage is having the full detail of it
}
}];