export type GetApiV1TransactionsReferenceWebhooksSenderArgs = {reference: string}; export type GetApiV1TransactionsReferenceWebhooksSenderOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get the SENDER webhook record * * GET /v1/transactions/{reference}/webhooks/sender */ export const getApiV1TransactionsReferenceWebhooksSender = async (args: GetApiV1TransactionsReferenceWebhooksSenderArgs, options?: GetApiV1TransactionsReferenceWebhooksSenderOptions) => { const {baseUrl = "https://idaas.yourflexpay.com/api", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/transactions/${encodeURIComponent(String(args.reference))}/webhooks/sender${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };