export type FanavaTransactionCommand = {amount?: number | undefined, bankDocumentNumber?: string | undefined, decideCode?: number | undefined, decideStatus?: string | undefined, invoiceNumber: string, referenceNumber: string, traceNumber?: number | undefined}; export type CreateApiApiPaymentFanavaReconfirmArgs = {body: FanavaTransactionCommand}; export type CreateApiApiPaymentFanavaReconfirmOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * reconfirm * * POST /api/payment/fanava/reconfirm */ export const createApiApiPaymentFanavaReconfirm = async (args: CreateApiApiPaymentFanavaReconfirmArgs, options: CreateApiApiPaymentFanavaReconfirmOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/payment/fanava/reconfirm${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 res.blob() };