export interface IInternalCashierPaymentsProps extends ICashierPaymentsProps { initApi?: (api: ICashierPaymentsApi) => void; experiments?: any; experimentsInstance?: any; } export interface IChargeResponse { chargeId?: string; transactionStatus?: string; redirectUrl?: string; failureDetails?: string; } export interface ICashierPaymentsProps { logger?: { appLoaded: () => any, interactionStarted: (name: string) => any, interactionEnded: (name: string) => any, }; host?: string; locale?: string; submitButtonClassName?: string; radioButtonClassName?: string; maxWidth?: number; configuration: ICashierPaymentsConfiguration; paymentMethodChanged?: (paymentMethodId: string, paymentMethodMetadata: any) => void; externalSubmitButton?: boolean; termsAndConditionsLink?: string; useTermsAndConditions?: boolean; walletPaymentInNewTab?: boolean; theme?: string; showOnlyCurrentStep?: boolean; paymentResult?: (data: any) => void; mandatoryFields?: any; onWalletPaymentComplete?: (result: any) => void; onPaymentStart?: (data: any) => void; onPaymentComplete?: (method: string, data: any) => void; onError?: (method, data: any) => void; } export interface ICashierPaymentsConfiguration { appId: string; appInstanceId: string; snapshotId?: string; amount?: string; msid?: string; locale: string; country?: string; visitorId: string; defaultPaymentMethod?: string; cashierPCIUrl?: string; walletExpressCheckoutAPIUrl?: string; } export interface ICashierPaymentsApi { pay?: () => Promise; tokenize?: () => Promise; continuePayment?: (chargeResponse: IChargeResponse, {inNewTab}?: {inNewTab: boolean}) => Promise; localizeError?: (errorCode: string, locale?: string) => Promise; launchPaymentPopup?: (chargeResponse?: IChargeResponse) => Promise; cancelPaymentPopup?: () => Promise; submit: () => Promise; validate: () => Promise; expand: () => Promise; collapse: () => Promise; initializePayment?: () => Promise; getAllMandatoryFields?: () => Promise; fetchPaymentMethods?: (country?: string) => Promise; fetchMandatoryFields?: (country?: string) => Promise; setMandatoryFields?: (mandatoryFields: any) => void; } export interface IOflineText { titleId: string; text: string; } export interface IPaymentMethod { paymentMethod: string; connectedProviderId: string; } export interface IOfflineText { titleId: string; text: string; } export interface ICashierPaymentsSettings { paymentMethods: IPaymentMethod[]; } // this enum will become bigger export const enum PaymentMethod { PAYPAL = 'payPal', CREDIT_CARD = 'creditCard', OFFLINE = 'offline', YANDEX = 'yandex', PAG_SEGURO = 'pagSeguro', MERCADO_PAGO = 'mercadoPago', }