export type PayoutWithVerificationTransfer = {bankDataId: string, verificationId: string, accountNumberRequested: unknown, hasDocument?: string | undefined, payoutDataVerificationType: 'LIAN_LIAN' | 'PINGPONG' | 'OFX' | 'BANK_STATEMENT' | 'BANK_TRANSFER' | 'NO_VERIFICATION_NEEDED', foreign: string, verificationTransferId: string, verified: string}; export type PayoutWithoutVerificationTransfer = {bankDataId: string, verificationId: string, accountNumberRequested: unknown, hasDocument?: string | undefined, swiftCode?: string | undefined, bankAddress?: string | undefined, bankCountry?: string | undefined, payoutDataVerificationType: 'LIAN_LIAN' | 'PINGPONG' | 'OFX' | 'BANK_STATEMENT' | 'BANK_TRANSFER' | 'NO_VERIFICATION_NEEDED', statementData?: ({accountNumberFromBank?: string | undefined, ownerName: string, address: {street?: string | undefined, zipcode?: string | undefined, city?: string | undefined, country?: unknown | undefined}}) | undefined, foreign: string, verified: string}; export type PayoutBankStatement = {bankDataId: string, verificationId: string, accountNumberRequested: unknown, hasDocument: string, payoutDataVerificationType: 'LIAN_LIAN' | 'PINGPONG' | 'OFX' | 'BANK_STATEMENT' | 'BANK_TRANSFER' | 'NO_VERIFICATION_NEEDED', foreign: string, verified: string}; export type CreateApiApiAmlVerificationV1DataloadingPayoutsBankAccountDataArgs = {'Content-Type': string, Authorization: string, body: PayoutWithVerificationTransfer | PayoutWithoutVerificationTransfer | PayoutBankStatement}; export type CreateApiApiAmlVerificationV1DataloadingPayoutsBankAccountDataOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add Bank Account for Payouts * * POST /api/aml-verification/v1/dataloading/payouts/bankAccountData */ export const createApiApiAmlVerificationV1DataloadingPayoutsBankAccountData = async (args: CreateApiApiAmlVerificationV1DataloadingPayoutsBankAccountDataArgs, options?: CreateApiApiAmlVerificationV1DataloadingPayoutsBankAccountDataOptions) => { const {baseUrl = "https://secure.payu.com", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/aml-verification/v1/dataloading/payouts/bankAccountData${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };