/** * All supported currency symbols. Single source of truth for the SDK. * * Lives alongside the country metadata so that adding a currency is a * single-folder operation: drop a new file in `currencies/.ts`, add it * to this map, and both `COUNTRY_OPTIONS` and `ZodCurrencySchema` pick it up. */ declare const CURRENCY: { readonly IDR: "IDR"; readonly INR: "INR"; readonly BRL: "BRL"; readonly ARS: "ARS"; readonly MEX: "MEX"; readonly VEN: "VEN"; readonly BOB: "BOB"; readonly EUR: "EUR"; readonly NGN: "NGN"; readonly USD: "USD"; readonly COP: "COP"; readonly CUP: "CUP"; readonly ECU: "ECU"; readonly PEN: "PEN"; readonly PHP: "PHP"; }; /** Union of supported currency codes. */ type CurrencyCode = (typeof CURRENCY)[keyof typeof CURRENCY]; /** * Tuple form of the currency codes — used by `z.enum(...)` in the shared * validation layer. Narrow tuple type required by Zod. */ declare const CURRENCY_CODES: [CurrencyCode, ...CurrencyCode[]]; /** Joins an optional QR payload with typed fields (`qr||phone|cci`). */ declare const PACKED_PAYMENT_ID_SEP = "||"; interface PaymentIdFieldConfig { readonly key: string; readonly label: string; readonly placeholder: string; readonly displayLabel: string | null; readonly validate: (value: string) => boolean; readonly validationErrorMessage: string; /** * When true, an empty value is allowed. If every field is optional, at least * one field must still be filled (see `validatePaymentIdFields`). */ readonly optional?: boolean; } interface CountryOption { readonly country: string; readonly currency: CurrencyCode; readonly internationalFormat?: string; readonly symbolNative: string; readonly locale: string; readonly paymentMethod: string; readonly paymentAddressName: string; readonly timezone: string; readonly timezone_name: string; readonly flag: string; readonly phoneCode?: string; readonly flagUrl: string; readonly telegramSupportChannel: string; readonly twitterUsername: string; readonly smsCountryCodes: readonly string[]; readonly precision: number; readonly isAlpha: boolean; readonly disabled: boolean; readonly disabledPaymentTypes: readonly string[]; /** * Merchant/seller provides payment details by uploading a QR image. * Distinct from PAY, where the buyer scans a QR. Default: false. */ readonly uploadPaymentQR?: boolean; /** Structural check for a standalone QR payload (no `||` pack). */ readonly validateQr?: (payload: string) => boolean; /** * PAY display: payload to re-draw a stored QR. May be looser than * `validateQr` so old orders still render (e.g. Yape/Plin without CRC, * Pago Móvil without `merchantId`). Scan & Pay uses `validateQr` / * parsers, not this hook. Apps call `getPayQrPayload(currency, id)` — * do not branch on currency. */ readonly getPayQrPayload?: (paymentId: string) => string | null; /** * Fill catalog fields from a validated QR (e.g. Yape/Plin phone in EMVCo). * Only used when the typed fallback did not already set the key. */ readonly hydrateFieldsFromQr?: (qr: string) => Partial>; /** * i18n key for a warning shown before the payer sends fiat (e.g. a bank * outage). Apps call `getTransferWarning(currency)` — do not branch on * currency. Omit when there is no warning. */ readonly transferWarning?: string; } /** All supported countries with their currency metadata, payment methods, and display config. */ declare const COUNTRY_OPTIONS: readonly CountryOption[]; declare function getCountryOption(currency: CurrencyCode | null | undefined): CountryOption | undefined; /** * Whether the merchant/seller provides payment details by uploading a QR image. * Distinct from PAY (`disabledPaymentTypes`), where the buyer scans a QR. */ declare function uploadsPaymentQR(currency: CurrencyCode | null | undefined): boolean; /** * Whether a stored payment ID may include a QR payload (`qr||fields` or * standalone QR). Derived from `validateQr` — no extra flag. */ declare function usesPackedPaymentId(currency: CurrencyCode | null | undefined): boolean; /** * Apps mount the catalog form (PackedPaymentInput): QR upload and typed * fields may both show — they are not exclusive. */ declare function usesCatalogPaymentForm(currency: CurrencyCode | null | undefined): boolean; /** * i18n key for a warning shown before the payer sends fiat, or `null` when the * currency has none. Apps translate with `t(key)` — do not branch on currency. */ declare function getTransferWarning(currency: CurrencyCode | null | undefined): string | null; /** Payment ID field configuration for each supported currency. */ declare const PAYMENT_ID_FIELDS: Record; /** * Yape/Plin EMVCo: country PE, currency 604, CRC-16/CCITT-FALSE. * Same rule for SELL upload and Scan & Pay (`parsePeru`). * `getPayQrPayload` may still re-draw a stored blob whose CRC later fails. */ declare function validatePeruvianQr(payload: string): boolean; /** * Bolivia QR Simple. Accepts either the encrypted envelope (Yape Bs, BancoSol * dynamic QR — `|<32-hex>`) or an EMVCo static QR (country BO, currency * 068, CRC-16/CCITT-FALSE). CRC / envelope shape is required on upload so we * never persist a truncated screenshot. */ declare function validateBolivianQr(payload: string): boolean; /** * Suiche 7B / Pago Móvil collection QR: `base64?merchantId=NNNN&…`. * The base64 is bank AES — we cannot decode phone/RIF from it, only the * envelope. Reject packed `||` IDs so a stored compound string is never * treated as a QR. Same rule for SELL upload and Scan & Pay (`parsePagoMovil`). * `getPayQrPayload` may still re-draw a stored blob without `merchantId`. */ declare function validateVenezuelanQr(payload: string): boolean; /** Validates a 20-digit Peruvian CCI (spaces ignored). */ declare function validatePeruvianCci(value: string): boolean; /** * Validates a Yape/Plin phone: `9` + 8 digits, optional `+51` / `51` prefix. */ declare function validatePeruvianPhone(value: string): boolean; /** * Validates a Peruvian payment key for the legacy single-field path. * Accepts either a 20-digit CCI or a Yape/Plin phone number. */ declare function validatePeruvianPaymentKey(value: string): boolean; type PeruvianPaymentIdParts = { qr: string | null; phone: string | null; cci: string | null; }; /** QR payload and/or CCI and/or Yape/Plin phone. A packed rest must be valid typed fields. */ declare function validatePeruvianPaymentId(value: string): boolean; /** * Validates Venezuelan phone number for Pago Movil. * Format: 04XX-XXXXXXX (11 digits starting with 04). */ declare function validateVenezuelanPhoneNumber(phoneNumber: string): boolean; /** * Validates Venezuelan Cédula/RIF for Pago Móvil. * Format: prefix (V|E|J|G|R|P) followed by digits. * Includes natural persons (V), foreigners (E), companies (J), government (G), * residual (R), and passport-linked accounts (P). */ declare function validateVenezuelanRif(rif: string): boolean; type VenezuelanPaymentIdParts = { qr: string | null; compound: string | null; }; /** * Accepts a Suiche 7B QR payload, the typed `phone|rif|bank` fallback, * or both packed as `qr||phone|rif|bank`. A non-empty packed rest must be a * valid compound — QR does not mask an incomplete trio. */ declare function validateVenezuelanPaymentId(value: string): boolean; /** * Validates Argentine payment IDs (CBU, CVU, or Alias). * CBU/CVU: 22 digits with checksum. Alias: 6-20 alphanumeric characters. */ declare function validateArgentinePaymentId(paymentId: string): boolean; /** * Validates a Bolivian bank account number for QR Simple transfers. * Accepts 8–20 digits; spaces and dashes are ignored. */ declare function validateBolivianAccount(account: string): boolean; /** * Validates PIX ID format. * PIX can be: CPF (11 digits), CNPJ (14 digits), email, phone (10–11 digits or E.164), * random key (UUID), or a PIX "copia e cola" EMV QR payload (starts with 000201). */ declare function validatePIXId(pixId: string): boolean; /** * Validates Colombian payment ID for Nequi, Daviplata, or Bre-B. * Accepts a 10-digit phone number starting with 3, a valid email address, * or a Bre-B alias starting with @ (e.g. @juanperez). */ declare function validateColombianPaymentId(paymentId: string): boolean; /** * Validates Cuban phone number for Transfermóvil. * Format: 8 digits, optionally prefixed with the +53 country code. */ declare function validateCubanPhoneNumber(phoneNumber: string): boolean; /** * Validates Cuban bank card number for Transfermóvil. * Format: 16 digits, spaces allowed (e.g., "9227 9598 7238 3620"). */ declare function validateCubanCardNumber(cardNumber: string): boolean; /** * Validates an Ecuadorian cédula (10-digit, módulo-10 checksum) or a 13-digit RUC * whose first 10 digits form a valid cédula. Province must be 01–24 and the third * digit < 6 (natural person). */ declare function validateEcuadorianCedula(value: string): boolean; /** Validates an Ecuadorian bank account number — 4–20 digits after stripping separators. */ declare function validateEcuadorianAccountNumber(value: string): boolean; /** Validates an account holder name — non-empty, letters/spaces/apostrophe/period/hyphen only. */ declare function validateEcuadorianAccountName(value: string): boolean; /** * Validates Revolut ID (username, email, or phone number). */ declare function validateRevolutId(revolutId: string): boolean; /** * Validates Indonesian phone number. * Validates just the number part (9-12 digits). */ declare function validateIndonesianPhoneNumber(phoneNumber: string): boolean; /** * Validates UPI ID format. * UPI ID format: username@bankname (e.g., john@paytm, user@ybl, 8658404239@kotak811) */ declare function validateUPIId(upiId: string): boolean; /** * Validates Mexican payment IDs (CLABE, card number, or phone number). * CLABE: 18 digits. Card: 16 digits. Phone: 10 digits. */ declare function validateMexicanPaymentId(paymentId: string): boolean; /** * Validates Nigerian bank account number (NUBAN format, 10 digits). */ declare function validateNigerianAccountNumber(accountNumber: string): boolean; /** * Validates a Nigerian bank account holder name (non-empty, letters/spaces/.'- only). */ declare function validateNigerianAccountName(accountName: string): boolean; /** * Validates a Philippine mobile number for InstaPay (GCash / Maya). * Mobile numbers are 10 digits starting with 9, and are commonly written * locally as `09XXXXXXXXX` or internationally as `+63 9XXXXXXXXX`. */ declare function validatePhilippinePhoneNumber(phoneNumber: string): boolean; /** Serializes multiple fields into a pipe-separated string. */ declare function serializeCompoundPaymentId(...fields: string[]): string; /** Deserializes a pipe-separated payment ID into its component fields. */ declare function deserializeCompoundPaymentId(paymentId: string): string[]; /** * Formats a compound payment ID for display using optional labels. * Empty parts (optional fields left blank) are omitted. */ declare function formatCompoundPaymentIdForDisplay(paymentId: string, labels: (string | null)[]): string; /** * Validates a stored payment ID against `PAYMENT_ID_FIELDS`. * Optional fields may be empty; if every field is optional, at least one must * be filled. A legacy single token (no `|`) matches any one field's validator. */ declare function validatePaymentIdFields(fields: readonly PaymentIdFieldConfig[], paymentId: string): boolean; /** * Splits a stored payment ID into per-field values for form hydration. * A legacy single token is assigned to the first field whose validator matches. */ declare function assignPaymentIdToFieldValues(fields: readonly PaymentIdFieldConfig[], paymentId: string): Record; declare function unpackPackedPaymentId(paymentId: string): { qr: string; rest: string; }; /** * QR blob from a stored payment ID, or `null` if none / invalid. */ declare function getStoredQrPayload(currency: CurrencyCode | null | undefined, paymentId: string | null | undefined): string | null; /** * Payload to feed `QRCodeSVG` for a PAY (or packed SELL) order. * Tries strict `getStoredQrPayload` first, then the country's PAY hook. */ declare function getPayQrPayload(currency: CurrencyCode | null | undefined, paymentId: string | null | undefined): string | null; /** * Builds a stored payment ID: optional validated QR packed with catalog fields. */ declare function packStoredPaymentId(currency: CurrencyCode, qr: string | null | undefined, fieldValues: Record): string; /** * Catalog payment form draft: optional QR and/or typed fields may coexist. * Neither path is required relative to the other. If any typed field has text, * non-optional fields must all be present and valid (`optional` on the catalog). */ declare function validateCatalogPaymentDraft(currency: CurrencyCode, qr: string | null | undefined, fieldValues: Record): boolean; /** * Validates a stored payment ID: optional packed QR, then catalog fields. * QR-only is valid when the country exposes `validateQr`. */ declare function validateStoredPaymentId(currency: CurrencyCode, paymentId: string): boolean; /** * Typed-field values for form hydration. Packed QR prefix is stripped. * `hydrateFieldsFromQr` fills keys the typed fallback left empty (PEN phone). */ declare function assignStoredPaymentIdToFieldValues(currency: CurrencyCode, paymentId: string): Record; /** * Human-readable stored ID: labeled typed fields, never the raw QR blob. * QR-only returns an empty string so the caller can substitute a label. */ declare function formatStoredPaymentIdForDisplay(currency: CurrencyCode, paymentId: string): string; export { COUNTRY_OPTIONS, CURRENCY, CURRENCY_CODES, type CountryOption, type CurrencyCode, PACKED_PAYMENT_ID_SEP, PAYMENT_ID_FIELDS, type PaymentIdFieldConfig, type PeruvianPaymentIdParts, type VenezuelanPaymentIdParts, assignPaymentIdToFieldValues, assignStoredPaymentIdToFieldValues, deserializeCompoundPaymentId, formatCompoundPaymentIdForDisplay, formatStoredPaymentIdForDisplay, getCountryOption, getPayQrPayload, getStoredQrPayload, getTransferWarning, packStoredPaymentId, serializeCompoundPaymentId, unpackPackedPaymentId, uploadsPaymentQR, usesCatalogPaymentForm, usesPackedPaymentId, validateArgentinePaymentId, validateBolivianAccount, validateBolivianQr, validateCatalogPaymentDraft, validateColombianPaymentId, validateCubanCardNumber, validateCubanPhoneNumber, validateEcuadorianAccountName, validateEcuadorianAccountNumber, validateEcuadorianCedula, validateIndonesianPhoneNumber, validateMexicanPaymentId, validateNigerianAccountName, validateNigerianAccountNumber, validatePIXId, validatePaymentIdFields, validatePeruvianCci, validatePeruvianPaymentId, validatePeruvianPaymentKey, validatePeruvianPhone, validatePeruvianQr, validatePhilippinePhoneNumber, validateRevolutId, validateStoredPaymentId, validateUPIId, validateVenezuelanPaymentId, validateVenezuelanPhoneNumber, validateVenezuelanQr, validateVenezuelanRif };