import {z} from 'zod' export type ConnectorType = 'payment_processor' | 'payment_vas' | 'fin_operations' | 'fiz_operations' | 'networks' | 'banking_entities' | 'non_banking_finance' | 'payout_processor' | 'payment_method_auth' | 'authentication_processor' | 'tax_processor' | 'surcharge_processor' | 'billing_processor' | 'vault_processor'; export type Connector = 'absa_sanlam' | 'authipay' | 'adyenplatform' | 'stripe_billing_test' | 'phonypay' | 'fauxpay' | 'pretendpay' | 'stripe_test' | 'adyen_test' | 'checkout_test' | 'paypal_test' | 'aci' | 'adyen' | 'affirm' | 'airwallex' | 'amazonpay' | 'archipel' | 'authorizedotnet' | 'bambora' | 'bamboraapac' | 'bankofamerica' | 'barclaycard' | 'billwerk' | 'bitpay' | 'bluesnap' | 'blackhawknetwork' | 'calida' | 'boku' | 'braintree' | 'breadpay' | 'cardinal' | 'cashtocode' | 'celero' | 'chargebee' | 'checkbook' | 'checkout' | 'coinbase' | 'coingate' | 'custombilling' | 'cryptopay' | 'ctp_mastercard' | 'ctp_visa' | 'cybersource' | 'cybersourcedecisionmanager' | 'datatrans' | 'deutschebank' | 'digitalvirgo' | 'dlocal' | 'dwolla' | 'ebanx' | 'envoy' | 'elavon' | 'facilitapay' | 'finix' | 'fiserv' | 'fiservemea' | 'fiservcommercehub' | 'fiuu' | 'flexiti' | 'forte' | 'getnet' | 'gigadat' | 'givepayments' | 'globalpay' | 'globepay' | 'gocardless' | 'gpayments' | 'hipay' | 'helcim' | 'hyperpg' | 'hyperswitch_vault' | 'interpayments' | 'inespay' | 'iatapay' | 'imerchantsolutions' | 'itaubank' | 'jpmorgan' | 'juspaythreedsserver' | 'klarna' | 'loonio' | 'mifinity' | 'mollie' | 'moneris' | 'multisafepay' | 'netcetera' | 'nexinets' | 'nexixpay' | 'nmi' | 'nomupay' | 'noon' | 'nordea' | 'novalnet' | 'nuvei' | 'opennode' | 'paybox' | 'payload' | 'payme' | 'payone' | 'paypal' | 'paysafe' | 'paystack' | 'paytm' | 'payconex' | 'payu' | 'peachpayments' | 'payjustnow' | 'payjustnowinstore' | 'phonepe' | 'placetopay' | 'powertranz' | 'prophetpay' | 'rapyd' | 'razorpay' | 'recurly' | 'redsys' | 'revolv3' | 'santander' | 'shift4' | 'silverflow' | 'square' | 'stax' | 'stripe' | 'stripebilling' | 'taxjar' | 'threedsecureio' | 'tesouro' | 'tokenex' | 'tokenio' | 'trustly' | 'truelayer' | 'trustpay' | 'trustpayments' | 'tsys' | 'tsys_transit' | 'vgs' | 'volt' | 'wellsfargo' | 'wise' | 'worldline' | 'worldpay' | 'worldpayvantiv' | 'worldpayxml' | 'worldpaymodular' | 'signifyd' | 'plaid' | 'riskified' | 'xendit' | 'zen' | 'zift' | 'zsl'; export type MerchantConnectorDetails = {connector_account_details?: (Record | null) | undefined, metadata?: (Record | null) | undefined}; export type PaymentMethod = 'card' | 'card_redirect' | 'pay_later' | 'wallet' | 'bank_redirect' | 'bank_transfer' | 'crypto' | 'bank_debit' | 'reward' | 'real_time_payment' | 'upi' | 'voucher' | 'gift_card' | 'open_banking' | 'mobile_payment' | 'network_token'; export type PaymentMethodType = 'ach' | 'affirm' | 'afterpay_clearpay' | 'alfamart' | 'ali_pay' | 'ali_pay_hk' | 'alma' | 'amazon_pay' | 'paysera' | 'apple_pay' | 'atome' | 'bacs' | 'bancontact_card' | 'becs' | 'benefit' | 'bizum' | 'blik' | 'bluecode' | 'boleto' | 'bca_bank_transfer' | 'bni_va' | 'breadpay' | 'bri_va' | 'bhn_card_network' | 'card_redirect' | 'cimb_va' | 'classic' | 'credit' | 'crypto_currency' | 'cashapp' | 'dana' | 'danamon_va' | 'debit' | 'duit_now' | 'efecty' | 'eft' | 'eft_debit_order' | 'eps' | 'flexiti' | 'fps' | 'evoucher' | 'giropay' | 'givex' | 'google_pay' | 'go_pay' | 'gcash' | 'ideal' | 'interac' | 'indomaret' | 'klarna' | 'kakao_pay' | 'local_bank_redirect' | 'mandiri_va' | 'knet' | 'mb_way' | 'mobile_pay' | 'momo' | 'momo_atm' | 'multibanco' | 'online_banking_thailand' | 'online_banking_czech_republic' | 'online_banking_finland' | 'online_banking_fpx' | 'online_banking_poland' | 'online_banking_slovakia' | 'oxxo' | 'pago_efectivo' | 'permata_bank_transfer' | 'open_banking_uk' | 'pay_bright' | 'payjustnow' | 'paypal' | 'paze' | 'pix' | 'pix_key' | 'pix_emv' | 'pix_qr' | 'pix_automatico_qr' | 'pix_automatico_push' | 'pay_safe_card' | 'przelewy24' | 'prompt_pay' | 'pse' | 'qris' | 'red_compra' | 'red_pagos' | 'samsung_pay' | 'sepa' | 'sepa_bank_transfer' | 'sepa_guarenteed_debit' | 'skrill' | 'sofort' | 'swish' | 'touch_n_go' | 'trustly' | 'twint' | 'upi_collect' | 'upi_intent' | 'upi_qr' | 'vipps' | 'viet_qr' | 'venmo' | 'walley' | 'we_chat_pay' | 'seven_eleven' | 'lawson' | 'mini_stop' | 'family_mart' | 'seicomart' | 'pay_easy' | 'local_bank_transfer' | 'mifinity' | 'open_banking_pis' | 'direct_carrier_billing' | 'instant_bank_transfer' | 'instant_bank_transfer_finland' | 'instant_bank_transfer_poland' | 'revolut_pay' | 'indonesian_bank_transfer' | 'open_banking' | 'network_token'; export type PaymentExperience = 'redirect_to_url' | 'invoke_sdk_client' | 'display_qr_code' | 'one_click' | 'link_wallet' | 'invoke_payment_app' | 'display_wait_screen' | 'collect_otp'; export type CardNetwork = 'Visa' | 'Mastercard' | 'AmericanExpress' | 'JCB' | 'DinersClub' | 'Discover' | 'CartesBancaires' | 'UnionPay' | 'Interac' | 'RuPay' | 'Maestro' | 'Star' | 'Pulse' | 'Accel' | 'Nyce' | 'Prop' | 'PrivateLabel' | 'Dinacard'; export type Currency = 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHF' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLE' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STD' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'UYU' | 'UZS' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL'; export type AcceptedCurrencies = {type: 'enable_only', list: Array} | {type: 'disable_only', list: Array} | {type: 'all_accepted'}; export type CountryAlpha2 = 'AF' | 'AX' | 'AL' | 'DZ' | 'AS' | 'AD' | 'AO' | 'AI' | 'AQ' | 'AG' | 'AR' | 'AM' | 'AW' | 'AU' | 'AT' | 'AZ' | 'BS' | 'BH' | 'BD' | 'BB' | 'BY' | 'BE' | 'BZ' | 'BJ' | 'BM' | 'BT' | 'BO' | 'BQ' | 'BA' | 'BW' | 'BV' | 'BR' | 'IO' | 'BN' | 'BG' | 'BF' | 'BI' | 'KH' | 'CM' | 'CA' | 'CV' | 'KY' | 'CF' | 'TD' | 'CL' | 'CN' | 'CX' | 'CC' | 'CO' | 'KM' | 'CG' | 'CD' | 'CK' | 'CR' | 'CI' | 'HR' | 'CU' | 'CW' | 'CY' | 'CZ' | 'DK' | 'DJ' | 'DM' | 'DO' | 'EC' | 'EG' | 'SV' | 'GQ' | 'ER' | 'EE' | 'ET' | 'FK' | 'FO' | 'FJ' | 'FI' | 'FR' | 'GF' | 'PF' | 'TF' | 'GA' | 'GM' | 'GE' | 'DE' | 'GH' | 'GI' | 'GR' | 'GL' | 'GD' | 'GP' | 'GU' | 'GT' | 'GG' | 'GN' | 'GW' | 'GY' | 'HT' | 'HM' | 'VA' | 'HN' | 'HK' | 'HU' | 'IS' | 'IN' | 'ID' | 'IR' | 'IQ' | 'IE' | 'IM' | 'IL' | 'IT' | 'JM' | 'JP' | 'JE' | 'JO' | 'KZ' | 'KE' | 'KI' | 'KP' | 'KR' | 'KW' | 'KG' | 'LA' | 'LV' | 'LB' | 'LS' | 'LR' | 'LY' | 'LI' | 'LT' | 'LU' | 'MO' | 'MK' | 'MG' | 'MW' | 'MY' | 'MV' | 'ML' | 'MT' | 'MH' | 'MQ' | 'MR' | 'MU' | 'YT' | 'MX' | 'FM' | 'MD' | 'MC' | 'MN' | 'ME' | 'MS' | 'MA' | 'MZ' | 'MM' | 'NA' | 'NR' | 'NP' | 'NL' | 'NC' | 'NZ' | 'NI' | 'NE' | 'NG' | 'NU' | 'NF' | 'MP' | 'NO' | 'OM' | 'PK' | 'PW' | 'PS' | 'PA' | 'PG' | 'PY' | 'PE' | 'PH' | 'PN' | 'PL' | 'PT' | 'PR' | 'QA' | 'RE' | 'RO' | 'RU' | 'RW' | 'BL' | 'SH' | 'KN' | 'LC' | 'MF' | 'PM' | 'VC' | 'WS' | 'SM' | 'ST' | 'SA' | 'SN' | 'RS' | 'SC' | 'SL' | 'SG' | 'SX' | 'SK' | 'SI' | 'SB' | 'SO' | 'ZA' | 'GS' | 'SS' | 'ES' | 'LK' | 'SD' | 'SR' | 'SJ' | 'SZ' | 'SE' | 'CH' | 'SY' | 'TW' | 'TJ' | 'TZ' | 'TH' | 'TL' | 'TG' | 'TK' | 'TO' | 'TT' | 'TN' | 'TR' | 'TM' | 'TC' | 'TV' | 'UG' | 'UA' | 'AE' | 'GB' | 'UM' | 'UY' | 'UZ' | 'VU' | 'VE' | 'VN' | 'VG' | 'VI' | 'WF' | 'EH' | 'YE' | 'ZM' | 'ZW' | 'US'; export type AcceptedCountries = {type: 'enable_only', list: Array} | {type: 'disable_only', list: Array} | {type: 'all_accepted'}; export type MinorUnit = number; export type RequestPaymentMethodTypes = {payment_method_type: PaymentMethodType, payment_experience?: (PaymentExperience | null) | undefined, card_networks?: (Array | null) | undefined, accepted_currencies?: (AcceptedCurrencies | null) | undefined, accepted_countries?: (AcceptedCountries | null) | undefined, minimum_amount?: (MinorUnit | null) | undefined, maximum_amount?: (MinorUnit | null) | undefined, recurring_enabled?: (boolean | null) | undefined, installment_payment_enabled?: (boolean | null) | undefined}; export type PaymentMethodsEnabled = {payment_method: PaymentMethod, payment_method_types?: (Array | null) | undefined}; export type MerchantConnectorWebhookDetails = {merchant_secret: string, additional_secret: string}; export type FrmPreferredFlowTypes = 'pre' | 'post'; export type FrmAction = 'cancel_txn' | 'auto_refund' | 'manual_review'; export type FrmPaymentMethodType = {payment_method_type: PaymentMethodType, card_networks: CardNetwork, flow: FrmPreferredFlowTypes, action: FrmAction}; export type FrmPaymentMethod = {payment_method: PaymentMethod, payment_method_types?: (Array | null) | undefined, flow?: (FrmPreferredFlowTypes | null) | undefined}; export type FrmConfigs = {gateway: ConnectorType, payment_methods: Array}; export type ConnectorStatus = 'inactive' | 'active'; export type MerchantAccountData = {iban: {iban: string, name: string, connector_recipient_id?: (string | null) | undefined}} | {bacs: {account_number: string, sort_code: string, name: string, connector_recipient_id?: (string | null) | undefined}} | {faster_payments: {account_number: string, sort_code: string, name: string, connector_recipient_id?: (string | null) | undefined}} | {sepa: {iban: string, name: string, connector_recipient_id?: (string | null) | undefined}} | {sepa_instant: {iban: string, name: string, connector_recipient_id?: (string | null) | undefined}} | {elixir: {account_number: string, iban: string, name: string, connector_recipient_id?: (string | null) | undefined}} | {bankgiro: {number: string, name: string, connector_recipient_id?: (string | null) | undefined}} | {plusgiro: {number: string, name: string, connector_recipient_id?: (string | null) | undefined}}; export type MerchantRecipientData = {connector_recipient_id: string | null} | {wallet_id: string | null} | {account_data: MerchantAccountData}; export type AdditionalMerchantData = {open_banking_recipient_data: MerchantRecipientData}; export type ConnectorWalletDetails = {apple_pay_combined?: (Record | null) | undefined, apple_pay?: (Record | null) | undefined, amazon_pay?: (Record | null) | undefined, samsung_pay?: (Record | null) | undefined, paze?: (Record | null) | undefined, google_pay?: (Record | null) | undefined}; export type MerchantConnectorCreate = {connector_type: ConnectorType, connector_name: Connector, connector_label?: (string | null) | undefined, profile_id?: (string | null) | undefined, connector_account_details?: (MerchantConnectorDetails | null) | undefined, payment_methods_enabled?: (Array | null) | undefined, connector_webhook_details?: (MerchantConnectorWebhookDetails | null) | undefined, metadata?: (Record | null) | undefined, test_mode?: (boolean | null) | undefined, disabled?: (boolean | null) | undefined, frm_configs?: (Array | null) | undefined, business_country?: (CountryAlpha2 | null) | undefined, business_label?: (string | null) | undefined, business_sub_label?: (string | null) | undefined, merchant_connector_id?: (string | null) | undefined, pm_auth_config?: (Record | null) | undefined, status?: (ConnectorStatus | null) | undefined, additional_merchant_data?: (AdditionalMerchantData | null) | undefined, connector_wallets_details?: (ConnectorWalletDetails | null) | undefined}; export type CreateApiAccountAccountIdConnectorsArgs = {account_id: string, body: MerchantConnectorCreate}; export type CreateApiAccountAccountIdConnectorsOptions = {baseUrl: string, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; export const connectorType = z.enum(["payment_processor", "payment_vas", "fin_operations", "fiz_operations", "networks", "banking_entities", "non_banking_finance", "payout_processor", "payment_method_auth", "authentication_processor", "tax_processor", "surcharge_processor", "billing_processor", "vault_processor"]); export const connector = z.enum(["absa_sanlam", "authipay", "adyenplatform", "stripe_billing_test", "phonypay", "fauxpay", "pretendpay", "stripe_test", "adyen_test", "checkout_test", "paypal_test", "aci", "adyen", "affirm", "airwallex", "amazonpay", "archipel", "authorizedotnet", "bambora", "bamboraapac", "bankofamerica", "barclaycard", "billwerk", "bitpay", "bluesnap", "blackhawknetwork", "calida", "boku", "braintree", "breadpay", "cardinal", "cashtocode", "celero", "chargebee", "checkbook", "checkout", "coinbase", "coingate", "custombilling", "cryptopay", "ctp_mastercard", "ctp_visa", "cybersource", "cybersourcedecisionmanager", "datatrans", "deutschebank", "digitalvirgo", "dlocal", "dwolla", "ebanx", "envoy", "elavon", "facilitapay", "finix", "fiserv", "fiservemea", "fiservcommercehub", "fiuu", "flexiti", "forte", "getnet", "gigadat", "givepayments", "globalpay", "globepay", "gocardless", "gpayments", "hipay", "helcim", "hyperpg", "hyperswitch_vault", "interpayments", "inespay", "iatapay", "imerchantsolutions", "itaubank", "jpmorgan", "juspaythreedsserver", "klarna", "loonio", "mifinity", "mollie", "moneris", "multisafepay", "netcetera", "nexinets", "nexixpay", "nmi", "nomupay", "noon", "nordea", "novalnet", "nuvei", "opennode", "paybox", "payload", "payme", "payone", "paypal", "paysafe", "paystack", "paytm", "payconex", "payu", "peachpayments", "payjustnow", "payjustnowinstore", "phonepe", "placetopay", "powertranz", "prophetpay", "rapyd", "razorpay", "recurly", "redsys", "revolv3", "santander", "shift4", "silverflow", "square", "stax", "stripe", "stripebilling", "taxjar", "threedsecureio", "tesouro", "tokenex", "tokenio", "trustly", "truelayer", "trustpay", "trustpayments", "tsys", "tsys_transit", "vgs", "volt", "wellsfargo", "wise", "worldline", "worldpay", "worldpayvantiv", "worldpayxml", "worldpaymodular", "signifyd", "plaid", "riskified", "xendit", "zen", "zift", "zsl"]); export const merchantConnectorDetails = z.object({connector_account_details: z.object({}).nullable().optional(), metadata: z.object({}).nullable().optional()}); export const paymentMethod = z.enum(["card", "card_redirect", "pay_later", "wallet", "bank_redirect", "bank_transfer", "crypto", "bank_debit", "reward", "real_time_payment", "upi", "voucher", "gift_card", "open_banking", "mobile_payment", "network_token"]); export const paymentMethodType = z.enum(["ach", "affirm", "afterpay_clearpay", "alfamart", "ali_pay", "ali_pay_hk", "alma", "amazon_pay", "paysera", "apple_pay", "atome", "bacs", "bancontact_card", "becs", "benefit", "bizum", "blik", "bluecode", "boleto", "bca_bank_transfer", "bni_va", "breadpay", "bri_va", "bhn_card_network", "card_redirect", "cimb_va", "classic", "credit", "crypto_currency", "cashapp", "dana", "danamon_va", "debit", "duit_now", "efecty", "eft", "eft_debit_order", "eps", "flexiti", "fps", "evoucher", "giropay", "givex", "google_pay", "go_pay", "gcash", "ideal", "interac", "indomaret", "klarna", "kakao_pay", "local_bank_redirect", "mandiri_va", "knet", "mb_way", "mobile_pay", "momo", "momo_atm", "multibanco", "online_banking_thailand", "online_banking_czech_republic", "online_banking_finland", "online_banking_fpx", "online_banking_poland", "online_banking_slovakia", "oxxo", "pago_efectivo", "permata_bank_transfer", "open_banking_uk", "pay_bright", "payjustnow", "paypal", "paze", "pix", "pix_key", "pix_emv", "pix_qr", "pix_automatico_qr", "pix_automatico_push", "pay_safe_card", "przelewy24", "prompt_pay", "pse", "qris", "red_compra", "red_pagos", "samsung_pay", "sepa", "sepa_bank_transfer", "sepa_guarenteed_debit", "skrill", "sofort", "swish", "touch_n_go", "trustly", "twint", "upi_collect", "upi_intent", "upi_qr", "vipps", "viet_qr", "venmo", "walley", "we_chat_pay", "seven_eleven", "lawson", "mini_stop", "family_mart", "seicomart", "pay_easy", "local_bank_transfer", "mifinity", "open_banking_pis", "direct_carrier_billing", "instant_bank_transfer", "instant_bank_transfer_finland", "instant_bank_transfer_poland", "revolut_pay", "indonesian_bank_transfer", "open_banking", "network_token"]); export const paymentExperience = z.enum(["redirect_to_url", "invoke_sdk_client", "display_qr_code", "one_click", "link_wallet", "invoke_payment_app", "display_wait_screen", "collect_otp"]); export const cardNetwork = z.enum(["Visa", "Mastercard", "AmericanExpress", "JCB", "DinersClub", "Discover", "CartesBancaires", "UnionPay", "Interac", "RuPay", "Maestro", "Star", "Pulse", "Accel", "Nyce", "Prop", "PrivateLabel", "Dinacard"]); export const currency = z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLE", "SLL", "SOS", "SRD", "SSP", "STD", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VES", "VND", "VUV", "WST", "XAF", "XCD", "XOF", "XPF", "YER", "ZAR", "ZMW", "ZWL"]); export const acceptedCurrencies = z.discriminatedUnion("type", [z.object({type: z.literal("enable_only"), list: z.array(currency)}), z.object({type: z.literal("disable_only"), list: z.array(currency)}), z.object({type: z.literal("all_accepted")})]); export const countryAlpha2 = z.enum(["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "KH", "CM", "CA", "CV", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SZ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW", "US"]); export const acceptedCountries = z.discriminatedUnion("type", [z.object({type: z.literal("enable_only"), list: z.array(countryAlpha2)}), z.object({type: z.literal("disable_only"), list: z.array(countryAlpha2)}), z.object({type: z.literal("all_accepted")})]); export const minorUnit = z.number().int(); export const requestPaymentMethodTypes = z.object({payment_method_type: paymentMethodType, payment_experience: paymentExperience.nullable().optional(), card_networks: z.array(cardNetwork).nullable().optional(), accepted_currencies: acceptedCurrencies.nullable().optional(), accepted_countries: acceptedCountries.nullable().optional(), minimum_amount: minorUnit.nullable().optional(), maximum_amount: minorUnit.nullable().optional(), recurring_enabled: z.boolean().nullable().optional(), installment_payment_enabled: z.boolean().nullable().optional()}); export const paymentMethodsEnabled = z.object({payment_method: paymentMethod, payment_method_types: z.array(requestPaymentMethodTypes).nullable().optional()}); export const merchantConnectorWebhookDetails = z.object({merchant_secret: z.string(), additional_secret: z.string()}); export const frmPreferredFlowTypes = z.enum(["pre", "post"]); export const frmAction = z.enum(["cancel_txn", "auto_refund", "manual_review"]); export const frmPaymentMethodType = z.object({payment_method_type: paymentMethodType, card_networks: cardNetwork, flow: frmPreferredFlowTypes, action: frmAction}); export const frmPaymentMethod = z.object({payment_method: paymentMethod, payment_method_types: z.array(frmPaymentMethodType).nullable().optional(), flow: frmPreferredFlowTypes.nullable().optional()}); export const frmConfigs = z.object({gateway: connectorType, payment_methods: z.array(frmPaymentMethod)}); export const connectorStatus = z.enum(["inactive", "active"]); export const merchantAccountData = z.union([z.object({iban: z.object({iban: z.string(), name: z.string(), connector_recipient_id: z.string().nullable().optional()})}), z.object({bacs: z.object({account_number: z.string(), sort_code: z.string(), name: z.string(), connector_recipient_id: z.string().nullable().optional()})}), z.object({faster_payments: z.object({account_number: z.string(), sort_code: z.string(), name: z.string(), connector_recipient_id: z.string().nullable().optional()})}), z.object({sepa: z.object({iban: z.string(), name: z.string(), connector_recipient_id: z.string().nullable().optional()})}), z.object({sepa_instant: z.object({iban: z.string(), name: z.string(), connector_recipient_id: z.string().nullable().optional()})}), z.object({elixir: z.object({account_number: z.string(), iban: z.string(), name: z.string(), connector_recipient_id: z.string().nullable().optional()})}), z.object({bankgiro: z.object({number: z.string(), name: z.string(), connector_recipient_id: z.string().nullable().optional()})}), z.object({plusgiro: z.object({number: z.string(), name: z.string(), connector_recipient_id: z.string().nullable().optional()})})]); export const merchantRecipientData = z.union([z.object({connector_recipient_id: z.string().nullable()}), z.object({wallet_id: z.string().nullable()}), z.object({account_data: merchantAccountData})]); export const additionalMerchantData = z.object({open_banking_recipient_data: merchantRecipientData}); export const connectorWalletDetails = z.object({apple_pay_combined: z.object({}).nullable().optional(), apple_pay: z.object({}).nullable().optional(), amazon_pay: z.object({}).nullable().optional(), samsung_pay: z.object({}).nullable().optional(), paze: z.object({}).nullable().optional(), google_pay: z.object({}).nullable().optional()}); export const eventType = z.enum(["payment_succeeded", "payment_failed", "payment_processing", "payment_cancelled", "payment_cancelled_post_capture", "payment_authorized", "payment_partially_authorized", "payment_captured", "payment_expired", "action_required", "refund_succeeded", "refund_failed", "dispute_opened", "dispute_expired", "dispute_accepted", "dispute_cancelled", "dispute_challenged", "dispute_won", "dispute_lost", "mandate_active", "mandate_revoked", "payout_success", "payout_failed", "payout_initiated", "payout_processing", "payout_cancelled", "payout_expired", "payout_reversed", "invoice_paid", "surcharge_payment_succeeded", "surcharge_refund_succeeded"]); export const webhookConfigType = z.union([z.literal("AllEvents"), z.object({CustomEvents: eventType.nullable()})]); export const webhookSetupCapabilities = z.object({is_webhook_auto_configuration_supported: z.boolean(), requires_webhook_secret: z.boolean().nullable().optional(), config_type: webhookConfigType.nullable().optional()}); export const merchantConnectorResponse = z.object({connector_type: connectorType, connector_name: connector, connector_label: z.string().nullable().optional(), merchant_connector_id: z.string(), profile_id: z.string().max(64), connector_account_details: merchantConnectorDetails.nullable().optional(), payment_methods_enabled: z.array(paymentMethodsEnabled).nullable().optional(), connector_webhook_details: merchantConnectorWebhookDetails.nullable().optional(), metadata: z.object({}).nullable().optional(), test_mode: z.boolean().nullable().optional(), disabled: z.boolean().nullable().optional(), frm_configs: z.array(frmConfigs).nullable().optional(), business_country: countryAlpha2.nullable().optional(), business_label: z.string().nullable().optional(), business_sub_label: z.string().nullable().optional(), applepay_verified_domains: z.array(z.string()).nullable().optional(), pm_auth_config: z.object({}).nullable().optional(), status: connectorStatus, additional_merchant_data: additionalMerchantData.nullable().optional(), connector_wallets_details: connectorWalletDetails.nullable().optional(), webhook_setup_capabilities: webhookSetupCapabilities.nullable().optional()}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Merchant Connector - Create * * POST /account/{account_id}/connectors */ export const createApiAccountAccountIdConnectors = async (args: CreateApiAccountAccountIdConnectorsArgs, options: CreateApiAccountAccountIdConnectorsOptions) => { const {baseUrl, fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/account/${encodeURIComponent(String(args.account_id))}/connectors${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(merchantConnectorResponse, await res.json()) };