import FormType from '../enums/FormType'
import CardBrand from '../enums/CardBrand'
import SecureBrand from '../enums/SecureBrand'
import FormButtonType from '../enums/FormButtonType'
import AdditionalFieldName from '../enums/AdditionalFieldName'

export default interface InitConfig {
  merchantData: {
    merchant: string
    signature: string
    paymentIntent: string
    version?: string
  }
  iframeParams?: Partial<{
    containerId: string
    width: string
  }>
  styles?: Record<string, unknown>
  formParams?: Partial<
    {
      enabled: boolean
      autoFocus: boolean
      submitButtonText: string
      isCardHolderVisible: boolean
      buttonType: FormButtonType
      headerText: string
      titleText: string
      formTypeClass: FormType
      isSolidLogoVisible: boolean
      cardBrands: CardBrand[]
      secureBrands: SecureBrand[]
      allowSubmit: boolean
      googleFontLink: string
      cardNumberLabel: string
      cardCvvLabel: string
      cardHolderLabel: string
      cardExpiryDateLabel: string
      zipLabel: string
      emailLabel: string
      zipCodeLabel: string
      cardNumberPlaceholder: string
      cardCvvPlaceholder: string
      cardHolderPlaceholder: string
      cardExpiryDatePlaceholder: string
      zipPlaceholder: string
      emailPlaceholder: string
      zipCodePlaceholder: string
    } & Record<`${AdditionalFieldName}Label`, string> &
      Record<`${AdditionalFieldName}Placeholder`, string>
  >
  googlePayButtonParams?: Partial<{
    allowedAuthMethods:
      | ['PAN_ONLY', 'CRYPTOGRAM_3DS']
      | ['PAN_ONLY']
      | ['CRYPTOGRAM_3DS']
    enabled: boolean
    containerId: string
    color: string
    type: string
  }>
  applePayButtonParams?: Partial<{
    enabled: boolean
    integrationType?: 'js' | 'css'
    containerId: string
    color: string
    type: string
  }>
  paypalButtonParams?: {
    enabled?: boolean
    containerId?: string
    color?: 'gold' | 'blue' | 'silver' | 'black'
    shape?: 'pill' | 'rect' | 'sharp'
    label?: 'paypal' | 'checkout' | 'buynow' | 'pay' | 'installment'
    height?: number
  }
  pixButtonParams?: {
    containerId?: string
    enabled?: boolean
    height?: number
    resetEnabled?: boolean
  }
  upiButtonParams?: {
    containerId?: string
    enabled?: boolean
    height?: number
    resetEnabled?: boolean
    type?: 'plain' | 'short'
  }
  pixQrButtonParams?: {
    containerId?: string
    enabled?: boolean
    height?: number
    resetEnabled?: boolean
  }
  bizumButtonParams?: {
    containerId?: string
    enabled?: boolean
    height?: number
  }
  blikButtonParams?: {
    containerId?: string
    enabled?: boolean
    theme?: 'light' | 'dark'
    height?: number
    resetEnabled?: boolean
  }
  mbwayButtonParams?: {
    containerId?: string
    enabled?: boolean
    height?: number
  }
  cashAppButtonParams?: {
    containerId?: string
    enabled?: boolean
  }
  pixAutomaticoButtonParams?: {
    containerId?: string
    enabled?: boolean
    height?: number
    resetEnabled?: boolean
  }
  clickToPayButtonParams?: {
    enabled?: boolean
    height?: number
    saveRecognitionToken?: boolean
    supportedCardNetworks?: ('mastercard' | 'visa' | 'amex' | 'discover')[]
  }
}
