export type DeleteApiV2ProfilesProfileIdMethodsMethodIdIssuersIssuerIdArgs = {'idempotency-key'?: string | undefined}; export type DeleteApiV2ProfilesProfileIdMethodsMethodIdIssuersIssuerIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Disable payment method issuer * * DELETE /v2/profiles/{profileId}/methods/{methodId}/issuers/{issuerId} * * Also accepts auth: advancedAccessToken, oAuth */ export const deleteApiV2ProfilesProfileIdMethodsMethodIdIssuersIssuerId = async (args: DeleteApiV2ProfilesProfileIdMethodsMethodIdIssuersIssuerIdArgs, options?: DeleteApiV2ProfilesProfileIdMethodsMethodIdIssuersIssuerIdOptions) => { const {baseUrl = "https://api.mollie.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['idempotency-key'] != null) headers.set("idempotency-key", String(args['idempotency-key'])) if (apiKey !== undefined) headers.set('authorization', `Bearer ${apiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/profiles/${encodeURIComponent(String(args.profileId))}/methods/${encodeURIComponent(String(args.methodId))}/issuers/${encodeURIComponent(String(args.issuerId))}${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 };