export type CreateApiApiAmlVerificationV1VerificationCancelArgs = {'Content-Type': string, Authorization: string, body: {verificationId: string, rejectionReasonComment?: string | undefined}}; export type CreateApiApiAmlVerificationV1VerificationCancelOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Cancel Verification * * POST /api/aml-verification/v1/verification/cancel */ export const createApiApiAmlVerificationV1VerificationCancel = async (args: CreateApiApiAmlVerificationV1VerificationCancelArgs, options?: CreateApiApiAmlVerificationV1VerificationCancelOptions) => { const {baseUrl = "https://secure.payu.com", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/aml-verification/v1/verification/cancel${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };