export type CreateApiWebhookRfiDefendOutcomeToDeDefinedArgs = {body: {ratepay_transaction_id?: string | undefined, ratepay_dispute_id?: string | undefined, partner_transaction_id?: string | undefined, publication_date?: string | undefined, amount?: number | undefined, currency?: string | undefined, type?: 'REQUEST_FOR_INFORMATION' | undefined, reason?: 'DEFEND' | undefined, resolution_date?: string | undefined, resolution_reason?: string | undefined, captures?: (Array<{date?: string | undefined, partner_operation_id?: string | undefined, ratepay_payment_reference?: string | undefined, ratepay_capture_id?: string | undefined}>) | undefined, payment_method?: ({payment_option?: string | undefined, transfer_type?: string | undefined}) | undefined}}; export type CreateApiWebhookRfiDefendOutcomeToDeDefinedOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Outcome for DEFEND * * POST /webhook-rfi-defend-outcome(to de defined) */ export const createApiWebhookRfiDefendOutcomeToDeDefined = async (args: CreateApiWebhookRfiDefendOutcomeToDeDefinedArgs, options: CreateApiWebhookRfiDefendOutcomeToDeDefinedOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/webhook-rfi-defend-outcome(to de defined)${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 };