Web Services
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.
PayUWebServiceResponse *webServiceResponse = [PayUWebServiceResponse new];1 Fetch Payment Option
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
3 Delete Store Card (Deprecated):
Use Delete Tokenised StoredCards
This API is helpful in Deleting StoredCard.
To integrate this API call the method deleteStoredCard as below
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
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:
5.2 For StoredCard/OneTapCard:
If merchant want to check offer for one particular storedcard then set the cardtoken as below:
If merchant want to check offer for all storedcard then set cardToken as empty or nil:
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:
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:
In case Merchant wants to know the list of net bankings which are eligible for any particular Offer then set bankCode as nil or empty as below:
After setting bankcode call the method getOfferDetails by passing second parameter as PAYMENT_PG_NET_BANKING as below:
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
7 Get User Cards (Deprecated):
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 getUserCards as below
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
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
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
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
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:
To integrate this API call the method saveUserCard as below:
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:
To integrate this API call the method saveUserCard as below:
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:
To integrate this API call the method getCheckoutDetail as below:
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
Below is example request for MCP as product type
For this API you need to set total amount, lookupAPI Hash, lookuprequestId in the payment params as below:
PFB details for params used in Lookup API
Parameter Name
Description
Amount
Transaction Amount
Card Bin
First 6 digits of card number
Currency
Base Currency of Transaction ("INR")
Merchant Access Key
Merchant Access Key provided by PayU
Merchant OrderId
A unique request id for Lookup API request
Product Type
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
To integrate this API call the method mcpLookup as below:
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:
Hash Calculation
Hash formula for check balance is
17 Get Tokenised PaymentDetails:
Get details of stored card to make payment on another PG
To integrate this API call the method getTokenizedPaymentDetails as below
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
19 Delete Tokenised StoredCards:
This API is helpful in Deleting StoredCard.
To integrate this API call the method deleteTokenizedStoredCard as below
Last updated
Was this helpful?