import { Locale, Environment, ThemeMode, Edges, ColorStyle, Scope } from '../enums'; export interface Customer { id?: string; name?: { lang: Locale; first: string; last: string; middle?: string; }[]; contact?: { email?: string; phone?: { countryCode: string; number: string; }; }; } export interface CardCallbacks { onReady?: () => void; onClick?: () => void; onError?: (error: any) => void; onSuccess?: (data: any) => void; onChargeCreated?: (charge: Record) => void; onOrderCreated?: (orderId: string) => void; } export interface CardButtonProps extends CardCallbacks { scope: Scope; operator: { publicKey: string; hashstring?: string; }; environment: Environment; merchant: { id: string; }; customer: Customer; transaction?: { authenticate?: { id?: string; required?: boolean; }; source?: { id?: string; }; authorize?: { auto: { type: string; time: number; }; }; metadata?: Record; reference?: string; paymentAgreement?: { id: string; contract?: { id: string; }; }; destinations?: Record; }; invoice?: { id: string; }; order: { id?: string; amount: number; currency: string; description?: string; metadata?: Record; reference?: string; }; interface?: { locale: Locale; theme: ThemeMode; edges: Edges; colorStyle: ColorStyle; loader: boolean; }; post?: { url: string; }; redirect?: { url: string; }; metaData?: MetaData; debug?: boolean; headers?: { mdn: string; application: string; }; cardType: string; } export interface MerchantResponse { id: string; name: string; country_code: string; session_token: string; powered_by: boolean; [other: string]: string | boolean; } export interface PaymentMethod { id: string; image: string; name: string; payment_type: string; supported_card_brands: Array; supported_currencies: object[]; [key: string]: any; } export interface PaymentOptionsResponse { id: string; country: string; currency: string; payment_methods: PaymentMethod[]; supported_currencies: any[]; order: { id: string; }; } export interface MetaData { merchant: MerchantResponse; payment_options: PaymentOptionsResponse; headers: Record; } export interface CheckoutProfileRequest { supported_payment_methods: string[]; supported_currencies?: string[]; transaction_mode: string; currency: string; merchant_id: string; total_amount: number; order: { id?: string; amount: number; currency: string; description?: string; metadata?: Record; customer?: { id?: string; email?: string; first_name?: string; last_name?: string; phone?: { country_code: string; number: string; }; }; items: { quantity: number; amount: number; currency: string; name: string; description: string; }[]; merchant: { id: string; }; }; } export interface ChargeRequestBody { source: { id: NonNullable['source']>['id']; }; authentication: { id: NonNullable['authenticate']>['id']; }; ipaddress?: string; amount: number; currency: string; selected_amount?: string; selected_currency?: string; product: 'Card-Button'; threeDSecure?: boolean; save_card: boolean; fee: number; customer: { id?: string; first_name?: string; middle_name?: string; last_name?: string; email?: string; phone?: { country_code: string; number: string; }; }; hashstring?: string; metadata?: Record; post?: { url: string; }; redirect?: { url: string; }; merchant?: { id: string; }; order?: { id: string; }; payment_agreement?: { id: string; contract?: { id: string; }; }; destinations?: Record; reference?: { order?: string; transaction?: string; }; description?: string; auto?: { type: string; time: number; }; }