export type PatchApiV1FrontendAccountsAccountId3dsToggleArgs = {accountId: number, body: string}; export type PatchApiV1FrontendAccountsAccountId3dsToggleOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Set requires3ds flag on a gateway account * * PATCH /v1/frontend/accounts/{accountId}/3ds-toggle */ export const patchApiV1FrontendAccountsAccountId3dsToggle = async (args: PatchApiV1FrontendAccountsAccountId3dsToggleArgs, options: PatchApiV1FrontendAccountsAccountId3dsToggleOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/frontend/accounts/${encodeURIComponent(String(args.accountId))}/3ds-toggle${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };