export type UpdateApiBookingV1AuthorizationActionsAuthorizationIdExpirePaymentLinkArgs = {authorizationId: string}; export type UpdateApiBookingV1AuthorizationActionsAuthorizationIdExpirePaymentLinkOptions = {baseUrl: string, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Expires the pending payment link with the payment provider and updates the status to Expired * * PUT /booking/v1/authorization-actions/{authorizationId}/expire-payment-link */ export const updateApiBookingV1AuthorizationActionsAuthorizationIdExpirePaymentLink = async (args: UpdateApiBookingV1AuthorizationActionsAuthorizationIdExpirePaymentLinkArgs, options: UpdateApiBookingV1AuthorizationActionsAuthorizationIdExpirePaymentLinkOptions) => { const {baseUrl, 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(/\/+$/, '')}/booking/v1/authorization-actions/${encodeURIComponent(String(args.authorizationId))}/expire-payment-link${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };