export type GetApiApiVVersionTestCallBackTransactionArgs = {paymentId?: number | undefined, ReferenceNumber?: string | undefined, version: string}; export type GetApiApiVVersionTestCallBackTransactionOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/v{version}/Test/callBackTransaction */ export const getApiApiVVersionTestCallBackTransaction = async (args: GetApiApiVVersionTestCallBackTransactionArgs, options: GetApiApiVVersionTestCallBackTransactionOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.paymentId != null) query.append("paymentId", String(args.paymentId)) if (args.ReferenceNumber != null) query.append("ReferenceNumber", String(args.ReferenceNumber)) if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/api/v${encodeURIComponent(String(args.version))}/Test/callBackTransaction${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };