API Reference@flopay/shared
Helpers
Validation and currency helper functions exported by @flopay/shared.
getCurrencyByCountry
Look up currency information by ISO 3166-1 alpha-2 country code. Falls back to USD when the country is not in the map.
| Parameter | Type | Required | Description |
|---|---|---|---|
countryCode | string | Yes | ISO 3166-1 alpha-2 country code (case-insensitive). |
Returns: CurrencyInfo -- the currency info for the given country, or DEFAULT_CURRENCY (USD) if not found.
isValidPublishableKey
Returns true if the string matches the format of a Stripe publishable key.
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | The key to validate. |
Returns: boolean -- true if the key matches /^pk_(test|live)_[A-Za-z0-9]+$/.
isValidSecretKey
Returns true if the string matches the format of a Stripe secret key.
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | The key to validate. |
Returns: boolean -- true if the key matches /^sk_(test|live)_[A-Za-z0-9]+$/.