Broadleaf Microservices
  • v1.0.0-latest-prod

Amazon Payment Services API Utilities

getAvailableInstallmentBanks

Gets the available banks (issuers) from the available installments.

Parameters

Parameter Type Required? Description

installments

AmazonPaymentServicesInstallments

The installments available for the current cart and language

defaultLanguage

string

The default language sales are made in, e.g., 'ar' or 'en'.

Response

Array of:

Parameter Type Required? Description

label

string

Bank label

value

string

Bank form value

id

string

Bank id

Example

import { getAvailableInstallmentBanks } from '@broadleaf/amazon-payment-services-api';

const banks = getAvailableInstallmentBanks(installments, 'en');

getAvailableInstallmentPlans

Gets the PlanDetails from the available installments.

Parameters

Parameter Type Required? Description

installments

AmazonPaymentServicesInstallments

The installments available for the current cart and language

Response

Array of PlanDetails.

Example

import { getAvailableInstallmentPlans } from '@broadleaf/amazon-payment-services-api';

const plans = getAvailableInstallmentPlans(installments);

determineCreditCardTypeFromBin

Determines the card type from the BIN.

Parameters

Parameter Type Required? Description

number

string

The BIN number

Response

The matching CardType.

Example

import { determineCreditCardTypeFromBin } from '@broadleaf/amazon-payment-services-api';

const cardNumber = "4263982640269299"; // CardType.VISA
const type = determineCreditCardTypeFromBin(cardNumber);