@flopay/shared 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1312,7 +1312,7 @@ declare function getConfiguredBillingApiUrl(): string;
1312
1312
  declare function getFloPayEnvironment(): FloPayEnvironment;
1313
1313
 
1314
1314
  /** Current SDK version. */
1315
- declare const SDK_VERSION = "1.3.0";
1315
+ declare const SDK_VERSION = "1.3.1";
1316
1316
  /**
1317
1317
  * HTTP header the SDK sends on `POST /v1/checkouts/sessions` so the backend
1318
1318
  * can decide whether to embed the vault capture block (the hosted PCI card
@@ -1744,6 +1744,29 @@ declare function getStateLabel(countryCode: string): string;
1744
1744
  */
1745
1745
  declare function getStateFromPostalCode(country: string, postalCode: string): string | null;
1746
1746
 
1747
+ /**
1748
+ * True when `validator` has an authoritative postcode pattern for the country
1749
+ * (ISO 3166-1 alpha-2, case-insensitive). Supported countries validate the
1750
+ * postcode format; unsupported / no-postcode countries fail open.
1751
+ */
1752
+ declare function isPostalCodeSupported(country: string): boolean;
1753
+ /**
1754
+ * Validate a postcode against the country's expected format.
1755
+ *
1756
+ * - Unsupported / no-postcode country → `true` (fail open; never block).
1757
+ * - Supported country → `validator`'s `isPostalCode(zip, locale)` on the
1758
+ * trimmed value. An empty string is not a valid postcode, so a supported
1759
+ * country with an empty value returns `false`; callers that distinguish
1760
+ * "required" (empty) from "malformed" (format) should check emptiness first.
1761
+ */
1762
+ declare function isValidPostalCode(country: string, postalCode: string): boolean;
1763
+ /**
1764
+ * A curated example postcode for the country (e.g. US `12345 or 12345-6789`,
1765
+ * GB `SW1A 1AA`, CA `A1A 1A1`), or `undefined` when there is no curated example
1766
+ * (unsupported country, or a supported country not in the map).
1767
+ */
1768
+ declare function getPostalCodeExample(country: string): string | undefined;
1769
+
1747
1770
  /** A single line item formatted for display in the checkout UI. */
1748
1771
  interface DisplayLineItem {
1749
1772
  name: string;
@@ -1875,4 +1898,4 @@ declare function isValidSecretKey(key: string): boolean;
1875
1898
  */
1876
1899
  declare function isSetupIntentClientSecret(clientSecret: string | null | undefined): boolean;
1877
1900
 
1878
- export { type AVSFieldConfig, BILLING_API_URL, BILLING_API_URL_PRODUCTION, BILLING_API_URL_STAGING, BOLD_DARK_APPEARANCE, BOLD_LIGHT_APPEARANCE, BUTTONS_LAYOUT_BOLD_DARK, BUTTONS_LAYOUT_BOLD_LIGHT, BUTTONS_LAYOUT_DARK, BUTTONS_LAYOUT_DEFAULT, BUTTONS_LAYOUT_GLASS_DARK, BUTTONS_LAYOUT_GLASS_LIGHT, BUTTONS_LAYOUT_MINIMAL, BUTTONS_LAYOUT_MODERN_DARK, BUTTONS_LAYOUT_MODERN_LIGHT, BUTTONS_LAYOUT_ROUNDED, type BeforeButtonClickEvent, type BillingDetails, type BillingProvider, type BuildCheckoutDisplayDataOptions, type ButtonsLayoutStyles, type ButtonsLayoutTheme, CA_PROVINCES, COUNTRY_OPTIONS, CURRENCY_MAP, type CardCaptureAdapter, type CardCaptureEventType, type CardCaptureMountOptions, type CardCaptureOutcomeEvent, type CardCaptureProviderId, type CheckoutAccount, type CheckoutButtonMethod, type CheckoutDisplayData, type CheckoutGateway, type CheckoutGateways, type CheckoutItem, type CheckoutMode, type CheckoutModeKind, type CheckoutProcessError, type CheckoutProcessingPending, type CheckoutProduct, type CheckoutProductType, type CheckoutSession, type CheckoutSessionProduct, type CheckoutSessionResult, type CheckoutSubscription, type ConfirmCardPaymentParams, type ConfirmCardPaymentResult, type ConfirmPaymentParams, type CountryOption, type CreateCustomerParams, type CreatePaymentMethodResult, type CreateSessionParams, type CurrencyInfo, type Customer, DEFAULT_API_BASE_URL, DEFAULT_API_VERSION, DEFAULT_APPEARANCE, DEFAULT_CURRENCY, type DeclineEvent, type DisplayLineItem, ELEMENT_TYPES, type ElementChangeEvent, type ElementOptions, type ElementType, FLAT_APPEARANCE, FLO_SDK_VERSION_HEADER, type FloPayAppearance, type FloPayConfig, type FloPayEnvironment, FloPayError, type FloPayErrorType, type FloPayThemeVariables, GLASS_DARK_APPEARANCE, GLASS_LIGHT_APPEARANCE, type GatewayEnvironment, type InlineSessionDraft, type InlineSessionParams, type InlineSessionPatch, type LineItem, MODERN_DARK_APPEARANCE, MODERN_LIGHT_APPEARANCE, type MountedElement, NIGHT_APPEARANCE, type NormalizedCheckoutSession, type NormalizedGatewayEnvironment, type PaymentProviderAdapter, type PaymentResult, type PriceData, type ProcessPaymentParams, type RecurringInterval, SDK_VERSION, STRIPE_EXPRESS_METHODS, STRIPE_METHOD_AMOUNT_LIMITS, STRIPE_METHOD_COUNTRIES, STRIPE_METHOD_CURRENCIES, STRIPE_METHOD_MATRIX, SUPPORTED_CARD_BRANDS, type StateOption, type StripeMethodEntry, type StripeMethodThemeVariant, THEMES, type TagsData, type ThemeBundle, type ThemeBundleId, type ThemeId, type TokenizedBody, US_STATES, type UpdateCustomerParams, type VaultCaptureBlock, type VaultCaptureResultMessage, type VaultCardFieldKey, type VaultCardThemeColors, type WebhookEvent, apiError, authenticationError, buildCheckoutDisplayData, buildItemPayload, buildProductPayload, buildSubscriptionPayload, configureFlopay, filterStripeMethodsByAmount, filterStripeMethodsByCountry, filterStripeMethodsByCurrency, foldIntoProducts, getConfiguredBillingApiUrl, getCountryByCode, getCurrencyByCountry, getFloPayEnvironment, getPostalCodeLabel, getStateFromPostalCode, getStateLabel, getStateOptions, getStripeMethodDisplayName, hasVendoredStripeMethodLogo, isAVSEnabled, isAVSFieldVisible, isSetupIntentClientSecret, isValidPublishableKey, isValidSecretKey, needsStripeMethodExplicitConfirm, networkError, normalizeGatewayEnvironment, partitionStripeMethods, rateLimitError, resolveAVSConfig, resolveBillingApiUrl, resolveButtonsLayoutTheme, resolveSessionCurrency, resolveStripeMethodBrandVariant, resolveTheme, stripeExpressMethodToOptionKey, validationError };
1901
+ export { type AVSFieldConfig, BILLING_API_URL, BILLING_API_URL_PRODUCTION, BILLING_API_URL_STAGING, BOLD_DARK_APPEARANCE, BOLD_LIGHT_APPEARANCE, BUTTONS_LAYOUT_BOLD_DARK, BUTTONS_LAYOUT_BOLD_LIGHT, BUTTONS_LAYOUT_DARK, BUTTONS_LAYOUT_DEFAULT, BUTTONS_LAYOUT_GLASS_DARK, BUTTONS_LAYOUT_GLASS_LIGHT, BUTTONS_LAYOUT_MINIMAL, BUTTONS_LAYOUT_MODERN_DARK, BUTTONS_LAYOUT_MODERN_LIGHT, BUTTONS_LAYOUT_ROUNDED, type BeforeButtonClickEvent, type BillingDetails, type BillingProvider, type BuildCheckoutDisplayDataOptions, type ButtonsLayoutStyles, type ButtonsLayoutTheme, CA_PROVINCES, COUNTRY_OPTIONS, CURRENCY_MAP, type CardCaptureAdapter, type CardCaptureEventType, type CardCaptureMountOptions, type CardCaptureOutcomeEvent, type CardCaptureProviderId, type CheckoutAccount, type CheckoutButtonMethod, type CheckoutDisplayData, type CheckoutGateway, type CheckoutGateways, type CheckoutItem, type CheckoutMode, type CheckoutModeKind, type CheckoutProcessError, type CheckoutProcessingPending, type CheckoutProduct, type CheckoutProductType, type CheckoutSession, type CheckoutSessionProduct, type CheckoutSessionResult, type CheckoutSubscription, type ConfirmCardPaymentParams, type ConfirmCardPaymentResult, type ConfirmPaymentParams, type CountryOption, type CreateCustomerParams, type CreatePaymentMethodResult, type CreateSessionParams, type CurrencyInfo, type Customer, DEFAULT_API_BASE_URL, DEFAULT_API_VERSION, DEFAULT_APPEARANCE, DEFAULT_CURRENCY, type DeclineEvent, type DisplayLineItem, ELEMENT_TYPES, type ElementChangeEvent, type ElementOptions, type ElementType, FLAT_APPEARANCE, FLO_SDK_VERSION_HEADER, type FloPayAppearance, type FloPayConfig, type FloPayEnvironment, FloPayError, type FloPayErrorType, type FloPayThemeVariables, GLASS_DARK_APPEARANCE, GLASS_LIGHT_APPEARANCE, type GatewayEnvironment, type InlineSessionDraft, type InlineSessionParams, type InlineSessionPatch, type LineItem, MODERN_DARK_APPEARANCE, MODERN_LIGHT_APPEARANCE, type MountedElement, NIGHT_APPEARANCE, type NormalizedCheckoutSession, type NormalizedGatewayEnvironment, type PaymentProviderAdapter, type PaymentResult, type PriceData, type ProcessPaymentParams, type RecurringInterval, SDK_VERSION, STRIPE_EXPRESS_METHODS, STRIPE_METHOD_AMOUNT_LIMITS, STRIPE_METHOD_COUNTRIES, STRIPE_METHOD_CURRENCIES, STRIPE_METHOD_MATRIX, SUPPORTED_CARD_BRANDS, type StateOption, type StripeMethodEntry, type StripeMethodThemeVariant, THEMES, type TagsData, type ThemeBundle, type ThemeBundleId, type ThemeId, type TokenizedBody, US_STATES, type UpdateCustomerParams, type VaultCaptureBlock, type VaultCaptureResultMessage, type VaultCardFieldKey, type VaultCardThemeColors, type WebhookEvent, apiError, authenticationError, buildCheckoutDisplayData, buildItemPayload, buildProductPayload, buildSubscriptionPayload, configureFlopay, filterStripeMethodsByAmount, filterStripeMethodsByCountry, filterStripeMethodsByCurrency, foldIntoProducts, getConfiguredBillingApiUrl, getCountryByCode, getCurrencyByCountry, getFloPayEnvironment, getPostalCodeExample, getPostalCodeLabel, getStateFromPostalCode, getStateLabel, getStateOptions, getStripeMethodDisplayName, hasVendoredStripeMethodLogo, isAVSEnabled, isAVSFieldVisible, isPostalCodeSupported, isSetupIntentClientSecret, isValidPostalCode, isValidPublishableKey, isValidSecretKey, needsStripeMethodExplicitConfirm, networkError, normalizeGatewayEnvironment, partitionStripeMethods, rateLimitError, resolveAVSConfig, resolveBillingApiUrl, resolveButtonsLayoutTheme, resolveSessionCurrency, resolveStripeMethodBrandVariant, resolveTheme, stripeExpressMethodToOptionKey, validationError };
package/dist/index.d.ts CHANGED
@@ -1312,7 +1312,7 @@ declare function getConfiguredBillingApiUrl(): string;
1312
1312
  declare function getFloPayEnvironment(): FloPayEnvironment;
1313
1313
 
1314
1314
  /** Current SDK version. */
1315
- declare const SDK_VERSION = "1.3.0";
1315
+ declare const SDK_VERSION = "1.3.1";
1316
1316
  /**
1317
1317
  * HTTP header the SDK sends on `POST /v1/checkouts/sessions` so the backend
1318
1318
  * can decide whether to embed the vault capture block (the hosted PCI card
@@ -1744,6 +1744,29 @@ declare function getStateLabel(countryCode: string): string;
1744
1744
  */
1745
1745
  declare function getStateFromPostalCode(country: string, postalCode: string): string | null;
1746
1746
 
1747
+ /**
1748
+ * True when `validator` has an authoritative postcode pattern for the country
1749
+ * (ISO 3166-1 alpha-2, case-insensitive). Supported countries validate the
1750
+ * postcode format; unsupported / no-postcode countries fail open.
1751
+ */
1752
+ declare function isPostalCodeSupported(country: string): boolean;
1753
+ /**
1754
+ * Validate a postcode against the country's expected format.
1755
+ *
1756
+ * - Unsupported / no-postcode country → `true` (fail open; never block).
1757
+ * - Supported country → `validator`'s `isPostalCode(zip, locale)` on the
1758
+ * trimmed value. An empty string is not a valid postcode, so a supported
1759
+ * country with an empty value returns `false`; callers that distinguish
1760
+ * "required" (empty) from "malformed" (format) should check emptiness first.
1761
+ */
1762
+ declare function isValidPostalCode(country: string, postalCode: string): boolean;
1763
+ /**
1764
+ * A curated example postcode for the country (e.g. US `12345 or 12345-6789`,
1765
+ * GB `SW1A 1AA`, CA `A1A 1A1`), or `undefined` when there is no curated example
1766
+ * (unsupported country, or a supported country not in the map).
1767
+ */
1768
+ declare function getPostalCodeExample(country: string): string | undefined;
1769
+
1747
1770
  /** A single line item formatted for display in the checkout UI. */
1748
1771
  interface DisplayLineItem {
1749
1772
  name: string;
@@ -1875,4 +1898,4 @@ declare function isValidSecretKey(key: string): boolean;
1875
1898
  */
1876
1899
  declare function isSetupIntentClientSecret(clientSecret: string | null | undefined): boolean;
1877
1900
 
1878
- export { type AVSFieldConfig, BILLING_API_URL, BILLING_API_URL_PRODUCTION, BILLING_API_URL_STAGING, BOLD_DARK_APPEARANCE, BOLD_LIGHT_APPEARANCE, BUTTONS_LAYOUT_BOLD_DARK, BUTTONS_LAYOUT_BOLD_LIGHT, BUTTONS_LAYOUT_DARK, BUTTONS_LAYOUT_DEFAULT, BUTTONS_LAYOUT_GLASS_DARK, BUTTONS_LAYOUT_GLASS_LIGHT, BUTTONS_LAYOUT_MINIMAL, BUTTONS_LAYOUT_MODERN_DARK, BUTTONS_LAYOUT_MODERN_LIGHT, BUTTONS_LAYOUT_ROUNDED, type BeforeButtonClickEvent, type BillingDetails, type BillingProvider, type BuildCheckoutDisplayDataOptions, type ButtonsLayoutStyles, type ButtonsLayoutTheme, CA_PROVINCES, COUNTRY_OPTIONS, CURRENCY_MAP, type CardCaptureAdapter, type CardCaptureEventType, type CardCaptureMountOptions, type CardCaptureOutcomeEvent, type CardCaptureProviderId, type CheckoutAccount, type CheckoutButtonMethod, type CheckoutDisplayData, type CheckoutGateway, type CheckoutGateways, type CheckoutItem, type CheckoutMode, type CheckoutModeKind, type CheckoutProcessError, type CheckoutProcessingPending, type CheckoutProduct, type CheckoutProductType, type CheckoutSession, type CheckoutSessionProduct, type CheckoutSessionResult, type CheckoutSubscription, type ConfirmCardPaymentParams, type ConfirmCardPaymentResult, type ConfirmPaymentParams, type CountryOption, type CreateCustomerParams, type CreatePaymentMethodResult, type CreateSessionParams, type CurrencyInfo, type Customer, DEFAULT_API_BASE_URL, DEFAULT_API_VERSION, DEFAULT_APPEARANCE, DEFAULT_CURRENCY, type DeclineEvent, type DisplayLineItem, ELEMENT_TYPES, type ElementChangeEvent, type ElementOptions, type ElementType, FLAT_APPEARANCE, FLO_SDK_VERSION_HEADER, type FloPayAppearance, type FloPayConfig, type FloPayEnvironment, FloPayError, type FloPayErrorType, type FloPayThemeVariables, GLASS_DARK_APPEARANCE, GLASS_LIGHT_APPEARANCE, type GatewayEnvironment, type InlineSessionDraft, type InlineSessionParams, type InlineSessionPatch, type LineItem, MODERN_DARK_APPEARANCE, MODERN_LIGHT_APPEARANCE, type MountedElement, NIGHT_APPEARANCE, type NormalizedCheckoutSession, type NormalizedGatewayEnvironment, type PaymentProviderAdapter, type PaymentResult, type PriceData, type ProcessPaymentParams, type RecurringInterval, SDK_VERSION, STRIPE_EXPRESS_METHODS, STRIPE_METHOD_AMOUNT_LIMITS, STRIPE_METHOD_COUNTRIES, STRIPE_METHOD_CURRENCIES, STRIPE_METHOD_MATRIX, SUPPORTED_CARD_BRANDS, type StateOption, type StripeMethodEntry, type StripeMethodThemeVariant, THEMES, type TagsData, type ThemeBundle, type ThemeBundleId, type ThemeId, type TokenizedBody, US_STATES, type UpdateCustomerParams, type VaultCaptureBlock, type VaultCaptureResultMessage, type VaultCardFieldKey, type VaultCardThemeColors, type WebhookEvent, apiError, authenticationError, buildCheckoutDisplayData, buildItemPayload, buildProductPayload, buildSubscriptionPayload, configureFlopay, filterStripeMethodsByAmount, filterStripeMethodsByCountry, filterStripeMethodsByCurrency, foldIntoProducts, getConfiguredBillingApiUrl, getCountryByCode, getCurrencyByCountry, getFloPayEnvironment, getPostalCodeLabel, getStateFromPostalCode, getStateLabel, getStateOptions, getStripeMethodDisplayName, hasVendoredStripeMethodLogo, isAVSEnabled, isAVSFieldVisible, isSetupIntentClientSecret, isValidPublishableKey, isValidSecretKey, needsStripeMethodExplicitConfirm, networkError, normalizeGatewayEnvironment, partitionStripeMethods, rateLimitError, resolveAVSConfig, resolveBillingApiUrl, resolveButtonsLayoutTheme, resolveSessionCurrency, resolveStripeMethodBrandVariant, resolveTheme, stripeExpressMethodToOptionKey, validationError };
1901
+ export { type AVSFieldConfig, BILLING_API_URL, BILLING_API_URL_PRODUCTION, BILLING_API_URL_STAGING, BOLD_DARK_APPEARANCE, BOLD_LIGHT_APPEARANCE, BUTTONS_LAYOUT_BOLD_DARK, BUTTONS_LAYOUT_BOLD_LIGHT, BUTTONS_LAYOUT_DARK, BUTTONS_LAYOUT_DEFAULT, BUTTONS_LAYOUT_GLASS_DARK, BUTTONS_LAYOUT_GLASS_LIGHT, BUTTONS_LAYOUT_MINIMAL, BUTTONS_LAYOUT_MODERN_DARK, BUTTONS_LAYOUT_MODERN_LIGHT, BUTTONS_LAYOUT_ROUNDED, type BeforeButtonClickEvent, type BillingDetails, type BillingProvider, type BuildCheckoutDisplayDataOptions, type ButtonsLayoutStyles, type ButtonsLayoutTheme, CA_PROVINCES, COUNTRY_OPTIONS, CURRENCY_MAP, type CardCaptureAdapter, type CardCaptureEventType, type CardCaptureMountOptions, type CardCaptureOutcomeEvent, type CardCaptureProviderId, type CheckoutAccount, type CheckoutButtonMethod, type CheckoutDisplayData, type CheckoutGateway, type CheckoutGateways, type CheckoutItem, type CheckoutMode, type CheckoutModeKind, type CheckoutProcessError, type CheckoutProcessingPending, type CheckoutProduct, type CheckoutProductType, type CheckoutSession, type CheckoutSessionProduct, type CheckoutSessionResult, type CheckoutSubscription, type ConfirmCardPaymentParams, type ConfirmCardPaymentResult, type ConfirmPaymentParams, type CountryOption, type CreateCustomerParams, type CreatePaymentMethodResult, type CreateSessionParams, type CurrencyInfo, type Customer, DEFAULT_API_BASE_URL, DEFAULT_API_VERSION, DEFAULT_APPEARANCE, DEFAULT_CURRENCY, type DeclineEvent, type DisplayLineItem, ELEMENT_TYPES, type ElementChangeEvent, type ElementOptions, type ElementType, FLAT_APPEARANCE, FLO_SDK_VERSION_HEADER, type FloPayAppearance, type FloPayConfig, type FloPayEnvironment, FloPayError, type FloPayErrorType, type FloPayThemeVariables, GLASS_DARK_APPEARANCE, GLASS_LIGHT_APPEARANCE, type GatewayEnvironment, type InlineSessionDraft, type InlineSessionParams, type InlineSessionPatch, type LineItem, MODERN_DARK_APPEARANCE, MODERN_LIGHT_APPEARANCE, type MountedElement, NIGHT_APPEARANCE, type NormalizedCheckoutSession, type NormalizedGatewayEnvironment, type PaymentProviderAdapter, type PaymentResult, type PriceData, type ProcessPaymentParams, type RecurringInterval, SDK_VERSION, STRIPE_EXPRESS_METHODS, STRIPE_METHOD_AMOUNT_LIMITS, STRIPE_METHOD_COUNTRIES, STRIPE_METHOD_CURRENCIES, STRIPE_METHOD_MATRIX, SUPPORTED_CARD_BRANDS, type StateOption, type StripeMethodEntry, type StripeMethodThemeVariant, THEMES, type TagsData, type ThemeBundle, type ThemeBundleId, type ThemeId, type TokenizedBody, US_STATES, type UpdateCustomerParams, type VaultCaptureBlock, type VaultCaptureResultMessage, type VaultCardFieldKey, type VaultCardThemeColors, type WebhookEvent, apiError, authenticationError, buildCheckoutDisplayData, buildItemPayload, buildProductPayload, buildSubscriptionPayload, configureFlopay, filterStripeMethodsByAmount, filterStripeMethodsByCountry, filterStripeMethodsByCurrency, foldIntoProducts, getConfiguredBillingApiUrl, getCountryByCode, getCurrencyByCountry, getFloPayEnvironment, getPostalCodeExample, getPostalCodeLabel, getStateFromPostalCode, getStateLabel, getStateOptions, getStripeMethodDisplayName, hasVendoredStripeMethodLogo, isAVSEnabled, isAVSFieldVisible, isPostalCodeSupported, isSetupIntentClientSecret, isValidPostalCode, isValidPublishableKey, isValidSecretKey, needsStripeMethodExplicitConfirm, networkError, normalizeGatewayEnvironment, partitionStripeMethods, rateLimitError, resolveAVSConfig, resolveBillingApiUrl, resolveButtonsLayoutTheme, resolveSessionCurrency, resolveStripeMethodBrandVariant, resolveTheme, stripeExpressMethodToOptionKey, validationError };
package/dist/index.mjs CHANGED
@@ -79,7 +79,7 @@ var PAYMENT_METHOD_LOGOS = {
79
79
  };
80
80
 
81
81
  // src/constants.ts
82
- var SDK_VERSION = "1.3.0";
82
+ var SDK_VERSION = "1.3.1";
83
83
  var FLO_SDK_VERSION_HEADER = "x-flo-sdk-version";
84
84
  var BILLING_API_URL_STAGING = "https://api.stage.flopay.com";
85
85
  var BILLING_API_URL_PRODUCTION = "https://api.flopay.com";
@@ -1856,6 +1856,67 @@ function getStateFromPostalCode(country, postalCode) {
1856
1856
  }
1857
1857
  }
1858
1858
 
1859
+ // src/postal-code-validation.ts
1860
+ import * as isPostalCodeModule from "validator/lib/isPostalCode.js";
1861
+ var mod = isPostalCodeModule;
1862
+ var isPostalCode = typeof mod.default === "function" ? mod.default : mod.default?.default;
1863
+ if (typeof isPostalCode !== "function") {
1864
+ throw new Error(
1865
+ "validator/lib/isPostalCode.js interop failed: unexpected module shape. This likely means the bundler's CJS/ESM interop changed."
1866
+ );
1867
+ }
1868
+ var SUPPORTED_LOCALES = new Set(
1869
+ mod.locales.map((code) => code.toUpperCase())
1870
+ );
1871
+ var LOCALE_ALIASES = {
1872
+ UK: "GB"
1873
+ };
1874
+ function normalizeCountry(country) {
1875
+ const upper = country.trim().toUpperCase();
1876
+ return LOCALE_ALIASES[upper] ?? upper;
1877
+ }
1878
+ var POSTAL_CODE_EXAMPLES = {
1879
+ US: "12345 or 12345-6789",
1880
+ GB: "SW1A 1AA",
1881
+ CA: "A1A 1A1",
1882
+ AU: "2000",
1883
+ NZ: "6011",
1884
+ IE: "D02 AF30",
1885
+ DE: "10115",
1886
+ FR: "75008",
1887
+ NL: "1011 AB",
1888
+ ES: "28001",
1889
+ IT: "00100",
1890
+ IN: "110001",
1891
+ JP: "100-0001",
1892
+ BR: "01310-100",
1893
+ MX: "01000",
1894
+ SE: "114 55",
1895
+ CH: "8001",
1896
+ PL: "00-001",
1897
+ PT: "1000-001",
1898
+ SG: "570150",
1899
+ ZA: "0001",
1900
+ NO: "0001",
1901
+ DK: "1050",
1902
+ FI: "00100",
1903
+ AT: "1010",
1904
+ BE: "1000",
1905
+ CZ: "100 00"
1906
+ };
1907
+ function isPostalCodeSupported(country) {
1908
+ if (!country) return false;
1909
+ return SUPPORTED_LOCALES.has(normalizeCountry(country));
1910
+ }
1911
+ function isValidPostalCode(country, postalCode) {
1912
+ if (!isPostalCodeSupported(country)) return true;
1913
+ return isPostalCode(postalCode.trim(), normalizeCountry(country));
1914
+ }
1915
+ function getPostalCodeExample(country) {
1916
+ if (!country) return void 0;
1917
+ return POSTAL_CODE_EXAMPLES[normalizeCountry(country)];
1918
+ }
1919
+
1859
1920
  // src/checkout-payload.ts
1860
1921
  function nonBlank(value) {
1861
1922
  if (typeof value !== "string") return void 0;
@@ -2112,6 +2173,7 @@ export {
2112
2173
  getCountryByCode,
2113
2174
  getCurrencyByCountry,
2114
2175
  getFloPayEnvironment,
2176
+ getPostalCodeExample,
2115
2177
  getPostalCodeLabel,
2116
2178
  getStateFromPostalCode,
2117
2179
  getStateLabel,
@@ -2120,7 +2182,9 @@ export {
2120
2182
  hasVendoredStripeMethodLogo,
2121
2183
  isAVSEnabled,
2122
2184
  isAVSFieldVisible,
2185
+ isPostalCodeSupported,
2123
2186
  isSetupIntentClientSecret,
2187
+ isValidPostalCode,
2124
2188
  isValidPublishableKey,
2125
2189
  isValidSecretKey,
2126
2190
  needsStripeMethodExplicitConfirm,