export type DeleteApiV3VaultPaymentTokensIdArgs = {id: string}; export type DeleteApiV3VaultPaymentTokensIdOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete payment token * * DELETE /v3/vault/payment-tokens/{id} */ export const deleteApiV3VaultPaymentTokensId = async (args: DeleteApiV3VaultPaymentTokensIdArgs, options?: DeleteApiV3VaultPaymentTokensIdOptions) => { const {baseUrl = "https://api-m.paypal.com", fetch: fetchFn = fetch, Oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Oauth2 !== undefined) headers.set('authorization', `Bearer ${Oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/v3/vault/payment-tokens/${encodeURIComponent(String(args.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 };