UNPKG

@adyen/kyc-components

Version:

`adyen-kyc-components` provides the required pieces to build an onboarding flow based on a legal entity. To onboard and verify users, you need to create a user interface (UI) to collect user data. To speed up building your integration, Adyen offers onboar

29 lines (28 loc) 1.92 kB
import type { Dispatch, StateUpdater } from 'preact/hooks'; import type { LoadingStatus } from '../components/ui/atoms/LoaderWrapper/constants'; import type { TopLevelDataSchema } from '../context/StateContext/types'; import type { AccountFormatRequirements, PayoutAccountFormats } from '../datasets/generators/getAccountFormatForCountry'; import type { GetConfigurationResponse } from '../core/models/api/get-configuration'; import type { CountryCode } from '../core/models/country-code'; import type { FormConfiguration } from '../core/models/form-configuration'; import type { BankAccountFormatType } from '../components/BankAccount/fields/BankAccountFormat/types'; export type ParseConfiguration<TLDS extends TopLevelDataSchema> = (configuration: GetConfigurationResponse & { requiredFields: AccountFormatRequirements | undefined; bankVerificationAvailable?: boolean; country: CountryCode; }) => FormConfiguration<TLDS, string>; export interface UseScenarioConfigurationOptions<TLDS extends TopLevelDataSchema> { getConfigurationData: () => Promise<GetConfigurationResponse>; parseConfiguration: ParseConfiguration<TLDS>; country: CountryCode; setLoadingStatus: Dispatch<StateUpdater<LoadingStatus>>; getPayoutAccountFormatData?: () => Promise<PayoutAccountFormats>; instantVerificationAvailable?: boolean; existingBankAccountFormat?: BankAccountFormatType; } interface ScenarioConfiguration<TLDS extends TopLevelDataSchema> { fieldConfigurations: FormConfiguration<TLDS, string> | undefined; requiredFields: AccountFormatRequirements | undefined; } export declare const useScenarioConfiguration: <TLDS extends TopLevelDataSchema>({ getConfigurationData, getPayoutAccountFormatData, parseConfiguration, country, instantVerificationAvailable, setLoadingStatus, existingBankAccountFormat, }: UseScenarioConfigurationOptions<TLDS>) => ScenarioConfiguration<TLDS>; export {};