export type SamanPaymentDTO = {amount: number, customerId?: number | undefined, customerLogin?: string | undefined, hashedPan?: string | undefined, id?: number | undefined, maskedPan?: string | undefined, merchantId: string, planId?: number | undefined, refNum?: string | undefined, resNum?: string | undefined, resNum1?: string | undefined, rrn: string, state?: string | undefined, status?: number | undefined, terminalId: string, traceNumber?: string | undefined, wage?: number | undefined}; export type UpdateApiApiSamanPaymentsArgs = {body: SamanPaymentDTO}; export type UpdateApiApiSamanPaymentsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * updateSamanPayment * * PUT /api/saman-payments */ export const updateApiApiSamanPayments = async (args: UpdateApiApiSamanPaymentsArgs, options: UpdateApiApiSamanPaymentsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/saman-payments${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 res.blob() };