export type DeleteApiPaymentMethodGroupsIdPaymentMethodsPaymentMethodIdArgs = {Authorization: string, 'Sub-Account'?: string | undefined, id: string, payment_method_id: string}; export type DeleteApiPaymentMethodGroupsIdPaymentMethodsPaymentMethodIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove a Payment Method from a Payment Method Group * * DELETE /payment_method_groups/{id}/payment_methods/{payment_method_id} */ export const deleteApiPaymentMethodGroupsIdPaymentMethodsPaymentMethodId = async (args: DeleteApiPaymentMethodGroupsIdPaymentMethodsPaymentMethodIdArgs, options?: DeleteApiPaymentMethodGroupsIdPaymentMethodsPaymentMethodIdOptions) => { const {baseUrl = "https://api.justifi.ai/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (args['Sub-Account'] != null) headers.set("Sub-Account", String(args['Sub-Account'])) const url = `${baseUrl.replace(/\/+$/, '')}/payment_method_groups/${encodeURIComponent(String(args.id))}/payment_methods/${encodeURIComponent(String(args.payment_method_id))}${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 };