import { CountryCode } from './country'; import { currencyCode } from './currency'; import { AcceptancePaymentType, ColorStyle, Direction, Edges, fullThemeModeValue, Locale, Purpose, Scope, ThemeMode } from './enums'; import { CARD_BRANDS, SupportedCardBrands } from './enums/cardBrands'; import { PAYMENT_METHODS, PaymentMethodName } from './enums/paymentMethods'; import { chargeStatus } from './enums/status'; import { ExtendableObject, ExtendableString } from './tsUtils'; type GeneralObject = { [key: string]: string; }; export declare namespace IntentAPI { interface Charge { object?: string; threeDSecure?: boolean; metadata?: GeneralObject; reference?: GeneralObject; source?: GeneralObject; required?: boolean; save_card?: boolean; } interface Transaction { card_holder_login?: ExtendableObject<{ type?: ExtendableString<'GUEST'>; timestamp?: string; }>; reference?: string; metadata?: GeneralObject; } interface Invoice { live_mode?: boolean; id?: string; draft?: boolean; } interface Tax { name?: string; description?: string; type?: string; amount: number; } interface Discount { type?: string; amount: number; } interface OrderItemProduct { id: string; amount?: number; name?: Array<{ text?: string; lang: string; }>; description?: Array<{ text: string; lang?: string; }>; category?: string; metadata?: object; reference?: { gtin?: string; code: string; financial_code: string; }; } interface OrderItem { count: number; list: Array; discount?: Array>; tax?: Array>; }>>; } type OrderShippingAddress = ExtendableObject<{ type: string; } & Partial<{ line1: string; line2: string; line3: string; line4: string; apartment: string; building: string; street: string; avenue: string; block: string; area: string; city: string; state: string; country: string; zip_code: string; postal_code: string; }>>; interface Order { id: string; amount: 2; currency: ExtendableString; items?: Array>; tax?: Array>; discount?: Array>; shipping: ExtendableObject<{ amount: number; description?: Array>; recipient_name?: Array>; address?: OrderShippingAddress; }>; } interface CustomerName { title?: string; first: string; middle: string; last: string; } interface CustomerContact { email?: string; phone?: { country_code?: string; number?: string; }; } interface Customer { id: string; name: Array>; contact?: ExtendableObject; } interface Acceptance { supported_currencies?: currencyCode[]; supported_payment_types?: ExtendableString<`${AcceptancePaymentType}`>[]; supported_payment_methods?: ExtendableString<`${PAYMENT_METHODS}`>[]; supported_schemes?: ExtendableString[]; supported_fund_source?: ExtendableString<'ALL' | 'DEBIT' | 'CREDIT'>[]; supported_payment_authentications?: ExtendableString<'3DS' | 'EMV' | 'PASSKEY'>[]; supported_payment_flows?: ExtendableString<'POPUP' | 'PAGE'>[]; } interface FieldVisibility { name: boolean; card?: ExtendableObject<{ number: boolean; expiry: boolean; cvv: boolean; cardholder: boolean; }>; contact?: { email: boolean; number: boolean; }; shipping?: { address: boolean; }; } interface Background { url: string; mode: string; color: Record; } enum InterfaceUserExperience { POPUP = "POPUP", PAGE = "PAGE", EMBEDDED = "EMBEDDED" } interface Interface { user_experience?: ExtendableString; locale?: ExtendableString; card_direction?: ExtendableString; direction?: ExtendableString; edges?: ExtendableString; theme?: ExtendableString; color_style?: ExtendableString; loader?: boolean; powered?: boolean; } interface Permission { card_wallet: boolean; threeDSecure: boolean; pci_dss: boolean; card_cvv: boolean; saved_card_cvv: boolean; } type PermissionKey = 'pci' | 'merchant_checkout' | 'threeDSecure_disabled' | 'kfast card_info' | 'issuer_enabled' | 'cvv_disabled' | 'saved_card_cvv_disabled' | 'apple_pay_wallet_enabled' | 'api_logs'; interface Assests { web: Theme; theme: Theme; localisation: { url: string; card: { url: string; }; }; } interface Theme { light: string; dark: string; card: Record; } interface SdkSettings { status_display_duration: number; otp_resend_interval: number; otp_resend_attempts: number; } interface Merchant { id: string; api_version: string; live_mode?: boolean; object: string; name: string; country_code: ExtendableString; logo: string; background: Background; contact: GeneralObject[]; powered_by: boolean; sdk_settings: SdkSettings; key_type: string; encryption_key: string; session_token: string; permissions: ExtendableString[]; permission: Permission; } interface LogoObject { svg: string; png: string; disabled: ImageFormatObject; currency_widget: ImageFormatObject; card_icon: ImageFormatObject; } interface ImageFormatObject { svg: string; png: string; } interface Color { base_color: string; background_colors: string[]; } interface ButtonStyle { background: Record; title_asset: string; } interface PaymentMethod { id: string; source_id?: string; name: PaymentMethodName; name_ar: string; image: string; payment_type: string; supported_card_brands: ExtendableString<`${CARD_BRANDS}`>[]; supported_currencies: currencyCode[]; order_by: number; cc_markup: number; asynchronous: false; threeDS: string; api_version: number; api_version_minor: number; logos: Record; payment_order_type: string; button_style: ButtonStyle; display_name: string; default_currency: string; mcc: string; passkey_enabled: boolean; scope: ExtendableString<'TOKEN' | 'AUTHENTICATED_TOKEN'>[]; gateway_merchant_id: string; } interface SupportedCurrency { symbol: string; name: string; flag: string; decimal_digit: number; selected: boolean; rate: number; logos: Record; order_by: number; currency: ExtendableString; amount: number; } interface PaymentOptions { id: string; object: string; payment_methods: ExtendableObject[]; currency: ExtendableString; country: ExtendableString; settlement_currency: ExtendableString; order: ExtendableObject<{ id: string; amount: number; currency: string; customer: { id?: string; email: string; phone?: { country_code: string; number: string; }; first_name?: string; last_name?: string; [key: string]: any; }; items: Array<{ name: string; amount: number; currency: string; quantity: number; requires_shipping: boolean; description: string; [key: string]: any; }>; }>; supported_currencies: SupportedCurrency[]; api_version: string; [key: string]: any; } interface Profile { status: string; merchant: Merchant; assests: Assests; session?: string; payment_options: PaymentOptions; } enum ConfigType { CARD = "CARD", BUTTON = "BUTTON", CHECKOUT = "CHECKOUT" } interface Config { initiator: ExtendableString<'MERCHANT' | 'CHECKOUT' | 'APP'>; type: ExtendableString; acceptance: ExtendableObject; field_visibility: ExtendableObject; interface: ExtendableObject; } interface Response { id: string; created: number; object: string; live_mode?: boolean | string; api_version: string; feature_version: string; status: ExtendableString; scope: Scope; purpose: ExtendableString<`${Purpose}`>; statement_descriptor: string; reference: string; customer_initiated: boolean; hash_string: string; authenticate?: ExtendableObject<{ required?: boolean; }>; charge?: ExtendableObject; transaction?: ExtendableObject; invoice: ExtendableObject; order: ExtendableObject; customer: ExtendableObject; config: ExtendableObject; profile: ExtendableObject; domain?: ExtendableObject<{ url: string; }>; receipt: ExtendableObject<{ email: boolean; sms: boolean; }>; merchant?: ExtendableObject<{ id: string; }>; post?: ExtendableObject<{ url: string; }>; redirect?: ExtendableObject<{ url: string; }>; platform?: ExtendableObject<{ id: string; }>; sdk_info?: ExtendableObject<{ type?: string; version?: string; ip?: string; mdn?: string; application?: string; }>; session: string; [key: string]: any; } } export {};