Web Services

React Native Core SDK consists of the following APIs:


Get Bin Info

Use this API to get the details of the cardBin passed in the request. When you call this API, you get the card_type, category, issuing_bank, is_atmpin_card as the response.

To integrate this API, call the getBinInfoβ€― command and pass the payment requestdata and the payment hash as parameters as shown in the code snippet below:

constβ€―responseβ€― =β€― awaitβ€―PayUSdk.getBinInfo({β€― 
  ...requestData,β€―   
  hash: getBinInfoHash(requestData)β€― 
});

Step 1: Build Request Data Object

Build the requestdata object as shown in the code snippet below:

requestData = {
  ...requestData,
  isBinInfo: '1',
  cardNumber: '555676',  
  command: 'getBinInfo'
}

Generate the Hash

Generate the hash with the code snippet shown below:

export const getBinInfoHash = (payUData) => {
  payUData.var1 = (payUData.isBinInfo)? payUData.isBinInfo : DEFAULT
  var hashString = `${payUData.key}|${payUData.command}|${payUData.var1}|${payUData.salt}`;
  return sha512(hashString);
}

Get Card Information (Check isDomestic)

Use this API to check if the card (passed in cardBin info API) is domestic or international. This API returns the following parameters: card_type, category, issuing_bank, is_atmpin_card, etc.

To integrate thisβ€―APIβ€―call the methodβ€―getBinInfo and pass therequestData and Hash as parametersβ€― as shown in the code snippet below:

constβ€―responseβ€― =β€― awaitβ€―PayUSdk.checkIsDomestic({β€― 
  ...requestData,β€― 
  hash: getCheckIsDomesticHash(requestData)β€― 
});

Build Payment Request Data

Build the requestdata object as shown in the code snippet below:

requestData = {
  ...requestData,
  cardNumber: <first 6 of card numbe>, //6 digit bin 
  command: 'check_isDomestic'
}

Generate the Hash

Generate the hash with the code snippet shown below:

export const getCheckIsDomesticHash = (payUData) => {
  payUData.var1 = (payUData.cardNumber)? payUData.cardNumber : DEFAULT
  var hashString = `${payUData.key}|${payUData.command}|${payUData.var1}|${payUData.salt}`;
  return sha512(hashString);
}

Get Checkout Details

Use this API to get the checkout details for the merchant. The merchant can pass specific parameters such as axSpecification, DownStatus, and AdditionalCharges and build the payment parameters accordingly.

To integrate thisβ€―APIβ€―call the methodβ€―getCheckoutDetailsβ€―and pass the requestData and Hash as parameters as shown in the code snippet below:

  const response = await PayUSdk.getCheckoutDetails({
      ...requestData,
      hash: getCheckoutDetailsHash(requestData)
  });

Build Payment Request Data

Build the requestdata object as shown in the code snippet below:

requestData = {
          ...requestData,
          var1: JSON.stringify({"useCase":
          {"getExtendedPaymentDetails":true,
          "getTaxSpecification":true,
          "checkDownStatus":true,
          "getAdditionalCharges":true,
          "getOfferDetails":true,
          "getPgIdForEachOption":true,
          "checkCustomerEligibility":true,
          "getMerchantDetails":true,
          "getPaymentDetailsWithExtraFields":true,
          "getSdkDetails":true},
          "requestId":"211219214632",
          "customerDetails":{"mobile":"9876543210"},
          "transactionDetails":{"amount":"1"}
    }),
 command: GET_CHECKOUT_DETAILS
}

Generate the Hash

Generate the hash with the code snippet shown below:

export const getCheckoutDetailsHash = (payUData) => {
  payUData.var1 = (payUData.var1)? payUData.var1 : DEFAULT
  var hashString = `${payUData.key}|${payUData.command}|${payUData.var1}|${payUData.salt}`;
  return sha512(hashString);
}

Get EMI Information

Use this API to get information to get details related to EMI such as EMI amount, tenure in month, interest rate, etc.

To integrate thisβ€―APIβ€―call the methodβ€―getEMIDetailsβ€―and pass therequestData and Hash as a parameter as shown in the code snippet below:

constβ€―responseβ€― =β€― awaitβ€―PayUSdk.getEMIDetails({β€― 
  ...requestData,β€― 
  hash:β€―getEMIDetailHash(requestData)β€― 
});

Build Payment Request Data

Build the requestdata object as shown in the code snippet below:

requestData β€―=  {β€― 
  ...requestData,β€― 
  amount:β€―'2000',β€― 
  command:β€―'getEmiAmountAccordingToInterest’ 
}

Generate the Hash

Generate the hash with the code snippet shown below:

export const getEMIDetailHash = (payUData) => {
  payUData.var1 = (payUData.amount)? payUData.amount : DEFAULT
  var hashString = `${payUData.key}|${payUData.command}|${payUData.var1}|${payUData.salt}`;
  return sha512(hashString);
}

Validate Offer

Use this API to validate the offer for the merchants.

To integrate thisβ€―APIβ€―call the methodβ€―validateOfferDetailsβ€―and pass the requestData as parameters as shown in the code snippet below:

constβ€―responseβ€― =β€― awaitβ€―PayUSdk.getEMIDetails({β€― 
  ...requestData,β€― 
  hash:β€―getEMIDetailHash(requestData)β€― 
});

Build Payment Request Data

Build the requestdata object as shown in the code snippet below:

requestData β€―=  {β€― 
  ...requestData,β€― 
  amount:β€―'2000',β€― 
  command:β€―'getEmiAmountAccordingToInterest’ 
}

Fetch Offer Details

Use this API to fetch the offer list available for the merchant.

To integrate thisβ€―APIβ€―call the methodβ€―fetchOfferDetailsβ€―and pass the requestData as parameters as shown in the code snippet below:

constβ€―responseβ€―=β€―awaitβ€―PayUSdk.fetchOfferDetails({β€― 

  ...requestData,β€― 

});

Build Payment Request Data

Build the requestdata object as shown in the code snippet below:

requestDataβ€―= {β€― 

 ...requestData,
 
  amount : 1,
  
  userCredential : "rahul:hooda",
  
  command : "get_all_offer_details"
}

Get Tokenised Card

Use this API to fetch the tokenized card based on the user_credential for the merchant.

To integrate thisβ€―APIβ€―call the methodβ€―getTokenisedCardβ€―and pass the requestData and Hash as parameters as shown in the code snippet below:

constβ€―responseβ€―=β€―awaitβ€―PayUSdk.fetchOfferDetails({β€― 

  ...requestData,β€― 

});

Build Payment Parameters

Build the requestdata object as shown in the code snippet below:

requestDataβ€―= {β€― 

 ...requestData,
 
  amount : 1,
  
  userCredential : "rahul:hooda",
  
  command : "get_all_offer_details"
}

Generate Payment Hash

Generate the hash with the code snippet shown below:

export const getTokenisedCardDetailsHash = (payUData) => {
  var hashString = `${payUData.key}|${payUData.command}|${payUData.var1}|${payUData.salt}`;
  return sha512(hashString);
}

Get Tokenised Card Details

Use this API to fetch one_click_status, card_name, card_token, token_reference_id, network_token, card_type, card_no, etc.

To integrate thisβ€―APIβ€―call the methodβ€―getTokenisedCardDetailsβ€―and pass the requestData and Hash as parameters as shown in the code snippet below:

constβ€―responseβ€―=β€―awaitβ€―PayUSdk.getTokenisedCardDetails({β€― 

  ...requestData,β€― 
  
  hash:getTokenisedCardDetailsHash(requestData)β€― 

});

Build Payment Parameters

Build the requestdata object as shown in the code snippet below:

requestDataβ€―= {β€― 

  ...requestData,β€― 
  
  var1:"rahul:hooda", //User Credential 
  
  var2:"67b442491a8f50793356a6", //Card Token
  
  var3:"100", //Amount 
  
  var4:"INR", //INR 
  
  command:β€―'get_payment_details’  

}

Generate Payment Hash

Generate the hash with the code snippet shown below:

export const getTokenisedCardDetailsHash = (payUData) => {
  var hashString = `${payUData.key}|${payUData.command}|${payUData.var1}|${payUData.salt}`;
  return sha512(hashString);
}

Delete Tokenised Card

Use this API to delete tokenized cards from the saved card list for the merchant.

To integrate thisβ€―APIβ€―call the methodβ€―deleteTokenisedCardβ€―and pass the requestData and Hash as parameters as shown in the code snippet below:

constβ€―responseβ€―=β€―awaitβ€―PayUSdk.getTokenisedCardDetails({β€― 
  ...requestData,β€― 
  hash:getTokenisedCardDetailsHash(requestData)β€― 
});

Build Payment Parameters

Build the requestdata object as shown in the code snippet below:

requestDataβ€―= {β€― 

  ...requestData,β€― 
  
  var1:"rahul:hooda", //User Credential 
  
  var2:"67b442491a8f50793356a6", //Card Token
  
  var3:"100", //Amount 
  
  var4:"INR", //INR 
  
  command:β€―'get_payment_details’  

}

Generate Payment Hash

Generate the hash with the code snippet shown below:

export const getTokenisedCardDetailsHash = (payUData) => {
  var hashString = `${payUData.key}|${payUData.command}|${payUData.var1}|${payUData.salt}`;
  return sha512(hashString);
}

Get Ibibo Codes

Use this API to fetch the list of Ibibo codes for the merchant along with information such as pg_id, bank_id, priority, title, etc.

To integrate thisβ€―APIβ€―call the methodβ€―getIbiboCodesβ€―and pass the requestData and Hash as parameters as shown in the code snippet below:

constβ€―responseβ€―=β€―awaitβ€―PayUSdk.getIbiboCodes({β€― 

  ...requestData,β€― 
  
  hash:getIbiboCodesHash(requestData)β€― 

});

Build Payment Request Data

Build the requestdata object as shown in the code snippet below:

requestDataβ€―= {β€― 

  ...requestData,β€― 
  
  var1:"default" ,
  
  command:β€―'get_merchant_ibibo_codes’  

}

Generate Payment Hash

Generate the hash with the code snippet shown below:

export const getIbiboCodesHash = (payUData) => {
  var hashString = `${payUData.key}|${payUData.command}|${payUData.var1}|${payUData.salt}`;
  return sha512(hashString);
}

Get Config

Use this API to fetch the config for the merchant.

To integrate thisβ€―APIβ€―call the methodβ€―getConfigβ€―and pass the requestData and Hash as parameters as shown in the code snippet below:

constβ€―responseβ€―=β€―awaitβ€―PayUSdk.getIbiboCodes({β€― 

  ...requestData,β€― 
  
  hash:getIbiboCodesHash(requestData)β€― 

});

Build Payment Request Data

Build the requestdata object as shown in the code snippet below:

requestDataβ€―= {β€― 

  ...requestData,β€― 
  
  var1:"default" ,
  
  command:β€―'get_merchant_ibibo_codes’  

}

Generate Payment Hash

Generate the hash with the code snippet shown below:

export const getIbiboCodesHash = (payUData) => {
  var hashString = `${payUData.key}|${payUData.command}|${payUData.var1}|${payUData.salt}`;
  return sha512(hashString);
}

Fetch IFSC Details

Use this API to fetch the IFSC details of the IFSC code from the merchant.

To integrate thisβ€―APIβ€―call the methodβ€―fetchIFSCDetailsβ€―and pass the requestData as parameters as shown in the code snippet below:

constβ€―responseβ€―=β€―awaitβ€―PayUSdk.fetchIFSCDetails({β€― 
  
  ...requestData
  
});

Build Payment Parameters

Build the requestdata object as shown in the code snippet below:

requestDataβ€―= {β€― 

  ...requestData,β€― 
  
  var1:"PUNB0387200"  //IFSC code
}

Check Balance – Sodexo

Use the API to check Sodexo card details, such as:

  • Card balance
  • Name on the card
  • Card number

To integrate thisβ€―APIβ€―call the methodβ€―checkBalance()β€―and pass the requestData and Hash as parameters as shown in the code snippet below:

constβ€―responseβ€―=β€―awaitβ€―PayUSdk.checkBalance({β€― 

  ...requestData,β€― 
  
  hash: getCheckBalanceHash(requestData)β€― 

});

Build Payment Parameters

Build the requestdata object as shown in the code snippet below:

requestDataβ€―= {β€― 

  ...requestData,β€― 
  
  var1:"{\"sodexoSourceId\":\"src_dcda7c39-47b2-45c4-8656-38d2d67d1715\"}" ,
  
  command:β€―'check_balance’  

}

Generate the Hash

Generate the hash with the code snippet shown below:

export const getCheckBalanceHash = (payUData) => {
  var hashString = `${payUData.key}|${payUData.command}|${payUData.var1}|${payUData.salt}`;
  return sha512(hashString);
}

Verify Payment

Use this API to fetch the transaction status of the transactionId passed in the request.

To integrate thisβ€―APIβ€―call the methodβ€―verifyPaymentβ€―and pass the requestData and Hash as parameters as shown in the code snippet below:

constβ€―responseβ€―=β€―awaitβ€―PayUSdk.verifyPayment({β€― 
  
  ...requestData,β€― 
  
  hash: getVerifyHash(requestData)β€― 

});

Build Payment Parameters

Build the requestdata object as shown in the code snippet below:

requestDataβ€―= {β€― 

  ...requestData,β€― 
  
  txnId: '1628684808250payusdk',
  
  command:β€―'verify_payment’  

}

Generate Payment Hash

Generate the hash with the code snippet shown below:

export const getVerifyHash = (payUData) => {
  var hashString = `${payUData.key}|${payUData.command}|${payUData.txnId}|${payUData.salt}`;
  return sha512(hashString);
}

Get Value-Added Service

Use this API to fetch upStatus/downStatus for different payment modes.

To integrate thisβ€―APIβ€―call the methodβ€―vasβ€―and pass the requestData and Hash as parameters as shown in the code snippet below:

constβ€―responseβ€―=β€―awaitβ€―PayUSdk.verifyPayment({β€― 
  
  ...requestData,β€― 
  
  hash: getVerifyHash(requestData)β€― 

});

Build Payment Parameters

Build the requestdata object as shown in the code snippet below:

requestDataβ€―= {β€― 

  ...requestData,β€― 
  
  txnId: '1628684808250payusdk',
  
  command:β€―'verify_payment’  

}

Generate Payment Hash

Generate the hash with the code snippet shown below:

export const getVerifyHash = (payUData) => {
  var hashString = `${payUData.key}|${payUData.command}|${payUData.txnId}|${payUData.salt}`;
  return sha512(hashString);
}

Lookup API

Use this API to fetch lookUp information for the merchant.

To integrate thisβ€―APIβ€―call the methodβ€―lookupAPIβ€―and pass requestData and Hash as parameter as shown in the code snippet below:

constβ€―responseβ€―=β€―awaitβ€―PayUSdk.lookupAPI({β€― 
  ...requestData,
  var1: JSON.stringify({
    ...lookupRequestData,
    signature: lookupHash
  }),
  hash: lookupHash

});

Build Payment Request Data

Build the requestdata object as shown in the code snippet below:

lookupRequestData= {β€― 

  "merchantAccessKey": "E5ABOXOWAAZNXB6JEF5Z",
  "baseAmount": {
            "value": "10000",
            "currency": "INR"
          },
  // "cardBin":"513382", // Need cardbin for DCC product
  "merchantOrderId": "OBE-JU89-13151-11009002,
  "productType": "MCP" // Use product DCC or MCP
  command:β€―'check_balance’  

}

Generate the Hash

Generate the hash with the code snippet shown below:


Get Transaction Data

Use this API to fetch transaction information for the merchant according to the request passed in the parameters.

To integrate thisβ€―APIβ€―call the methodβ€―getTransactionInfoβ€―and pass therequestData and Hash as parameter as shown in the code snippet below:

constβ€―responseβ€―=β€―awaitβ€―PayUSdk.lookupAPI({β€― 
  ...requestData,
  var1: JSON.stringify({
    ...lookupRequestData,
    signature: lookupHash
  }),
  hash: lookupHash

});

Build Payment Request Data

Build the requestdata object as shown in the code snippet below:

lookupRequestData= {β€― 

  "merchantAccessKey": "E5ABOXOWAAZNXB6JEF5Z",
  "baseAmount": {
            "value": "10000",
            "currency": "INR"
          },
  // "cardBin":"513382", // Need cardbin for DCC product
  "merchantOrderId": "OBE-JU89-13151-11009002,
  "productType": "MCP" // Use product DCC or MCP
  command:β€―'check_balance’  

}

Generate the Hash

Generate the hash with the code snippet shown below:

export const getGetTransactionInfoHash = (payUData) => {
  payUData.var1 = (payUData.startTime)? payUData.startTime : DEFAULT
  var hashString = `${payUData.key}|${payUData.command}|${payUData.var1}|${payUData.salt}`;
  return sha512(hashString);
}

Fetch Payment Options

Use this API to fetch the available payment options for a customer based on the userCredential. In response, this API fetches savedCard options, ibiboCodes, and different payment modes for available transactions.

To integrate thisβ€―APIβ€―call the methodβ€―fetchPaymentOptionsβ€―and pass therequestData and Hash as a parameter as shown in the code snippet below:

constβ€―responseβ€― =β€― awaitβ€―PayUSdk.fetchPaymentOptions({β€― 

  ...requestData,β€― 
  
  hash: getWebHash(requestData)β€― 

});

Build Payment Request Data

Build the requestdata object as shown in the code snippet below:

requestData β€―=  {β€― 

  ...requestData,β€― 
  
  userCredentials:β€―"rahul:hooda",β€― 
  
  command:β€―'payment_related_details_for_mobile_sdk’  

}

Generate the Hash

Generate the hash with the code snippet shown below:

export const getWebHash = (payUData) => {
    payUData.var1 = (payUData.userCredentials)? payUData.userCredentials : DEFAULT
    var hashString = `${payUData.key}|${payUData.command}|${payUData.var1}|${payUData.salt}`;
    return sha512(hashString);
}