import {Braintree} from '../../extensions/three_domain_secure/handlers/braintree/types'; import {ComponentType} from './base-types'; import { Events, Field, HostedFields, Locale as L, Child, Host, Master, Card, IDeal, EventKeys, CardIconPosition, } from './enums'; import {PaymentMethodType} from '../../internal/payment-intent/types'; import {Metadata} from '../../plugins/logger/types'; export interface CommunicationMessage { message: ActionInnerMessage | ResponseInnerMessage; error?: ActionInnerMessage | ResponseInnerMessage; replyId: string; srcWindowName?: string; cbEvent: boolean; targetWindowName: string; } export interface ActionInnerMessage { action: Master.Actions | Child.Actions | Host.Actions; data?: any; options?: { noReply?: boolean; }; } export interface ResponseInnerMessage {} export declare type CbToken = { token: string; vaultToken?: string; additional_information?: TokenizationResponseAdditionalInfo; }; export declare const AllowedListeners: Events[]; export declare const AllowedCardIcons: string[]; export declare const AllowedKeyPressEvents: EventKeys[]; export declare type Error = { name: string; message: string; }; export declare type ValidationErrorMessage = { errorCode: string; message: string; }; export declare type InitOptions = { site: string; publishableKey: string; }; export declare type FieldComponentOptions = { field?: FieldOptions; component?: ComponentOptions; cardIconPosition?: CardIconPosition; }; export declare type ComponentOptions = { [HostedFields.Options.currency]?: string; [HostedFields.Options.classes]?: Classes; [HostedFields.Options.style]?: Styles; [HostedFields.Options.fonts]?: Fonts; [HostedFields.Options.field]?: Fields; [HostedFields.Options.locale]?: Locale; [HostedFields.Options.placeholder]?: Placeholder; [HostedFields.Options.ariaLabel]?: AriaLabel; translations?: Translations; showTestCards?: boolean; }; export declare type FieldOptions = { [HostedFields.Options.style]?: Styles; [HostedFields.Options.placeholder]?: string; [HostedFields.Options.ariaLabel]?: string; }; export declare type Classes = { [HostedFields.CSSClass.focus]?: string; [HostedFields.CSSClass.empty]?: string; [HostedFields.CSSClass.invalid]?: string; [HostedFields.CSSClass.complete]?: string; }; export declare type FieldConfiguration = { [HostedFields.FieldOption.required]?: boolean; [HostedFields.FieldOption.show]?: boolean; }; declare let defaultFieldConfiguration: FieldConfiguration; export default defaultFieldConfiguration; export declare type Fields = { [HostedFields.Field.cvv]?: FieldConfiguration; }; export declare type StyleBlock = CSSStyleBlock & PseudoStyleBlock; export declare type Styles = { [HostedFields.StyleSections.base]?: StyleBlock; [HostedFields.StyleSections.empty]?: StyleBlock; [HostedFields.StyleSections.invalid]?: StyleBlock; }; export declare type Fonts = FontFace[]; export declare type FontFace = { fontFamily: string; src?: string; fontStyle?: string; fontWeight?: string; }; export declare type FontURL = string; export declare type Locale = L; export declare type Placeholder = { [HostedFields.Placeholder.number]?: string; [HostedFields.Placeholder.expiry]?: string; [HostedFields.Placeholder.cvv]?: string; }; export declare type CSSStyleBlock = { [HostedFields.CustomCSSProperty.iconColor]?: string; [HostedFields.StdCSSProperty.color]?: string; [HostedFields.StdCSSProperty.background]?: string; [HostedFields.StdCSSProperty.backgroundColor]?: string; [HostedFields.StdCSSProperty.letterSpacing]?: string; [HostedFields.StdCSSProperty.textAlign]?: string; [HostedFields.StdCSSProperty.textTransform]?: string; [HostedFields.StdCSSProperty.textDecoration]?: string; [HostedFields.StdCSSProperty.textShadow]?: string; [HostedFields.StdCSSProperty.lineHeight]?: string; [HostedFields.StdCSSProperty.webkitTextColor]?: string; [HostedFields.FontProperty.src]?: string; [HostedFields.FontProperty.fontFamily]?: string; [HostedFields.FontProperty.fontSize]?: string; [HostedFields.FontProperty.fontSmoothing]?: string; [HostedFields.FontProperty.fontStyle]?: string; [HostedFields.FontProperty.fontWeight]?: string; [HostedFields.FontProperty.fontVariant]?: string; }; export declare type PseudoStyleBlock = { [HostedFields.PseudoCSSProperty.hover]?: CSSStyleBlock; [HostedFields.PseudoCSSProperty.focus]?: CSSStyleBlock; [HostedFields.PseudoCSSProperty.disabled]?: CSSStyleBlock; [HostedFields.PseudoCSSProperty.placeholder]?: CSSStyleBlock; [HostedFields.PseudoCSSProperty.selection]?: CSSStyleBlock; [HostedFields.PseudoCSSProperty.autofill]?: CSSStyleBlock; [HostedFields.PseudoCSSProperty.focusPlaceholder]?: CSSStyleBlock; }; export declare type AriaLabel = { [HostedFields.AriaLabel.number]?: string; [HostedFields.AriaLabel.expiry]?: string; [HostedFields.AriaLabel.cvv]?: string; }; export declare type InputFieldOptions = { mxw: string; name: Field; autocomplete: string; maxlength: number; placeholder: string; describedby: string; fieldDesc: string; ariaLabel: string; }; export declare type MessageData = { componentName?: string; type?: ComponentType; baseOptions?: ComponentOptions; fonts?: FontFace[]; name?: string; fieldType?: Card.ComponentFieldType | IDeal.ComponentFieldType; frame?: string; options?: FieldOptions; metadata?: Metadata; }; export declare type FontsWhitelist = { fonts: FontFace[]; whitelist: string[]; }; export declare type FieldValue = { [id: string]: FieldStatus & { value?: string; }; }; export declare type FieldStatus = ValidationStatus & { forceValidation?: boolean; isFocused?: boolean; value?: string; }; export declare type ValidationStatus = { isComplete?: boolean; isEmpty?: boolean; isValid?: boolean; isInvalid?: boolean; cardType?: any; binData?: BINData; error?: string; }; export declare type ComponentMeta = { name: string; type: ComponentType; frames: Array; options?: ComponentOptions; data?: any; }; export declare type BroadcastStatus = any; export declare type _FieldChangeEvent = { type: Events; key?: EventKeys; complete: boolean; error: ValidationErrorMessage; empty: boolean; }; export interface BINData { bin?: string; last4?: string; brand?: string; isPrepaid?: boolean; cardType?: string; countryName?: string; verificationInfo?: { rule_id: string; verification_control: string; }; } export declare type FieldChangeEvent = _FieldChangeEvent & { field: Card.ComponentFieldType; cardType: string; binData?: BINData; }; export declare type IDealFieldChangeEvent = _FieldChangeEvent & { field: IDeal.ComponentFieldType; value: any; }; export declare type EventMessage = { event: Events; key: EventKeys; frame: string; status?: { [Card.ComponentFieldType.Number]?: FieldStatus; [Card.ComponentFieldType.Expiry]?: FieldStatus; [Card.ComponentFieldType.CVV]?: FieldStatus; }; data?: any; }; export declare type ReplyMessageOptions = { timeout?: number; action?: string; }; export declare type CbTokenResponse = { token: { created_at: number; gateway: string; gateway_account_id: string; id: string; id_at_vault: string; ip_address: string; object: string; payment_method_type: string; status: string; vault: string; }; }; export declare type Translations = { [LanguageCode: string]: { [key: string]: string; }; }; export declare type tokenizationResponse = { pm_list: Array; }; export declare type gatewayAdditionalInfo = { kount_merchant_id?: string; }; export interface StateFullPromise extends Promise { isResolved: () => boolean; isFulfilled: () => boolean; isPending: () => boolean; isRejected: () => boolean; } export declare type TestCard = { number: string; cvv: string; name: string; exp_month: string; exp_year: string; desc?: string; }; export declare type TestCardStyleBlock = { border?: string; borderRadius?: string; height?: string; }; export declare type CbTokenizationAPIInput = { gateway_account_id: string; payment_method_type: PaymentMethodType; id_at_vault: string; gw_obj_type: 'token'; additional_information?: string; }; export declare type GwTokenizationResponse = { token: string; deviceData: { braintree?: Braintree.FraudData; }; additional_information: TokenizationResponseAdditionalInfo; }; export declare type TokenizationResponseAdditionalInfo = { braintree?: Braintree.TokenizationAdditionalInfo; }; export interface BinDataResponse { card_bin_info: Array<{ brand: string; isPrepaid: boolean; cardType: string; countryName: string; }>; verification_info: { rule_id: string; verification_control: string; verification_control_outcome: Record; verification_outcome_translation_key: string; }; }