FloPay
API Reference@flopay/shared

Constants

All constants exported by @flopay/shared, including SDK version, themes, element types, card brands, and currency mappings.

SDK Version and API

SDK_VERSION

const SDK_VERSION: string = '0.1.0';

Current SDK version string.

DEFAULT_API_BASE_URL

const DEFAULT_API_BASE_URL: string = 'https://api.flopay.io';

Default FloPay API base URL used by @flopay/node.

DEFAULT_API_VERSION

const DEFAULT_API_VERSION: string = '2024-01-01';

Default API version header value.


Themes

DEFAULT_APPEARANCE

const DEFAULT_APPEARANCE: FloPayAppearance = {
  theme: 'default',
  variables: {
    colorPrimary: '#4A49FF',
    colorBackground: '#FFFFFF',
    colorText: '#262833',
    colorDanger: '#DF1B41',
    borderRadius: '8px',
    fontFamily: 'Poppins, system-ui, sans-serif',
    fontSizeBase: '16px',
    spacingUnit: '4px',
  },
};

The default appearance applied when no custom appearance is provided.

FLAT_APPEARANCE

const FLAT_APPEARANCE: FloPayAppearance = {
  theme: 'flat',
  variables: {
    ...DEFAULT_APPEARANCE.variables,
    borderRadius: '4px',
  },
};

Flat theme with minimal borders and shadows. Inherits all variables from DEFAULT_APPEARANCE except borderRadius.

NIGHT_APPEARANCE

const NIGHT_APPEARANCE: FloPayAppearance = {
  theme: 'night',
  variables: {
    colorPrimary: '#7B7BFF',
    colorBackground: '#1A1A2E',
    colorText: '#E0E0E0',
    colorDanger: '#FF6B6B',
    borderRadius: '8px',
    fontFamily: 'Poppins, system-ui, sans-serif',
    fontSizeBase: '16px',
    spacingUnit: '4px',
  },
};

Night (dark) theme with a dark background.


Element Types

ELEMENT_TYPES

const ELEMENT_TYPES: readonly ['payment', 'card', 'cardNumber', 'cardExpiry', 'cardCvc', 'address'];

All supported element type identifiers. Used to validate element creation.


Card Brands

SUPPORTED_CARD_BRANDS

const SUPPORTED_CARD_BRANDS: readonly ['visa', 'mastercard', 'mastercard_debit', 'amex', 'discover'];

List of supported card brands.


Currency

CURRENCY_MAP

const CURRENCY_MAP: Record<string, CurrencyInfo>;

Maps ISO 3166-1 alpha-2 country codes to currency information. Includes entries for:

RegionCountriesCurrency
Eurozone + EUAT, BE, BG, CY, CZ, DE, DK, EE, ES, FI, FR, GR, HR, HU, IE, IT, LT, LU, LV, MT, NL, PL, PT, RO, SE, SI, SKEUR
United KingdomGBGBP
United StatesUSUSD
CanadaCACAD
New ZealandNZNZD
AustraliaAUAUD

Each entry is a CurrencyInfo object with currency, symbol, country, countryCode, and tax (0 or 1).

DEFAULT_CURRENCY

const DEFAULT_CURRENCY: CurrencyInfo = {
  currency: 'USD',
  symbol: '$',
  country: 'United States',
  countryCode: 'US',
  tax: 0,
};

Default currency information returned when a country is not in CURRENCY_MAP.

On this page