BIN Lookup

Card information based on the Bank Identification Number (BIN)

Using your account Public API Key on MoneyHash class instance you will be able to have the functionality of the following method

const moneyHash = new MoneyHash({
  type: "payment",
  publicApiKey: "<account_public_api_key>",
});

Collect Card Data

After collecting card info as mentioned here.

const cardData = await moneyHash.cardForm.collect();

You will need to render card form fields to be able to collect customer card information.

Bin Lookup

try {
  const binLookup = await moneyHash.cardForm.binLookup({
    cardData,
    // flowId: '<flow_id>' // accepts optional flowId
  });
  console.log(binLookup); // bin lookup data of type BinLookUpData
} catch (error) {
  console.log(error);
}

Bin Lookup with Receipts

Using receipts that is received from apple pay (refer to Apple Pay & Native Pay Methods), you can make a bin lookup using moneyhash.binLookupByReceipt method.

try {
  const binLookup = await moneyHash.binLookupByReceipt({
    nativeReceiptData: applePayReceipt,
    methodId: <method-id>, // the method id used for bin lookup, received from nativePayData
    // flowId: '<flow_id>' // accepts optional flowId
  });
  console.log(binLookup); // bin lookup data of type BinLookUpData
} catch (error) {
  console.log(error);
}

export type BinLookUpData = {
  firstSixDigits: string;
  brand: string;
  cardType: string | null;
  issuer: string | null;
  issuerCountry: string | null;
  issuerCountryCode: string | null;
};