export type User = {activated: boolean, clubCardNumber?: number | undefined, clubCode?: number | undefined, clubType?: ('AYRIA' | 'PERSEPOLIS' | 'KARAFARIN' | 'BIMEHKHAVARMIYANE') | undefined, email?: string | undefined, firstName?: string | undefined, fullname?: string | undefined, gender?: ('MALE' | 'FEMALE') | undefined, id?: number | undefined, imageUrl?: string | undefined, langKey?: string | undefined, lastName?: string | undefined, locked?: boolean | undefined, login: string, mobile?: string | undefined, nickname?: string | undefined, notSystem?: boolean | undefined, originClubCode?: number | undefined, persepolisi?: boolean | undefined, plan?: ('BASIC' | 'GOLD' | 'STAR' | 'GALAXY') | undefined, system?: boolean | undefined}; export type BillingCommand = {billId?: string | undefined, description?: string | undefined, login?: string | undefined, mobile?: string | undefined, paymentId?: string | undefined, user?: User | undefined}; export type CreateApiApiUserBillPayStep1Args = {body: BillingCommand}; export type CreateApiApiUserBillPayStep1Options = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * step1 * * POST /api/user/bill/pay/step1 */ export const createApiApiUserBillPayStep1 = async (args: CreateApiApiUserBillPayStep1Args, options: CreateApiApiUserBillPayStep1Options) => { 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/user/bill/pay/step1${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 res.blob() };