export type DeleteApiV1ShoppersMeCartsActivePaymentArgs = {token?: string | undefined}; export type DeleteApiV1ShoppersMeCartsActivePaymentOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Detach all applied payment methods from the cart * * DELETE /v1/shoppers/me/carts/active/payment */ export const deleteApiV1ShoppersMeCartsActivePayment = async (args: DeleteApiV1ShoppersMeCartsActivePaymentArgs, options?: DeleteApiV1ShoppersMeCartsActivePaymentOptions) => { const {baseUrl = "https://api.digitalriver.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.token != null) query.append("token", String(args.token)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/shoppers/me/carts/active/payment${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };