export type AcceptorContact = {acceptor?: Acceptor | undefined, contactType: 'TELEGRAM' | 'INSTAGRAM' | 'FACEBOOK' | 'LINKEDIN' | 'TWITTER' | 'WHATSAPP' | 'EMAIL' | 'ADDRESS' | 'COORDINATES' | 'TELEPHONE' | 'MOBILE' | 'WEBSITE', id?: number | undefined, value?: string | undefined}; export type PaymentTool = {acceptor: Acceptor, accountBank?: ('EGHTESAD_NOVID' | 'ANSAR' | 'IRAN_ZAMIN' | 'PARSIAN' | 'PASARGAD' | 'TAT' | 'TEJARAT' | 'TOSAE_TAVON' | 'TOSAE_SADERAT' | 'HEKMAT_IRANIAN' | 'DAY' | 'REFAH' | 'SAMAN' | 'SEPAH' | 'SARMAYEH' | 'SINA' | 'SHAHR' | 'SADERAT' | 'SANAT_O_MADAN' | 'MEHR' | 'GHAVAMIN' | 'KAR_AFARIN' | 'KESHAVARZI' | 'GARDESHGARI' | 'MARKAZI' | 'MASKAN' | 'MELLAT' | 'MELLI' | 'MEHR_EGHTESAD' | 'POST' | 'TOSAE' | 'KOSAR' | 'MIDDLE_EAST' | 'OTHER') | undefined, accountBranch?: string | undefined, accountBranchCode?: string | undefined, accountName?: string | undefined, accountNumber?: string | undefined, accountSheba?: string | undefined, confirmed?: boolean | undefined, documents?: Array | undefined, id?: number | undefined, merchant?: string | undefined, name?: string | undefined, password?: string | undefined, picked?: boolean | undefined, posType?: ('GPRS' | 'TYPICAL' | 'LAN' | 'M' | 'PC' | 'WIFI') | undefined, sent?: boolean | undefined, sentMessage?: string | undefined, serial?: string | undefined, terminal?: string | undefined, type: 'WALLET' | 'POS' | 'IPG', username?: string | undefined}; export type Document = {acceptor?: Acceptor | undefined, contentContentType?: string | undefined, description?: string | undefined, documentIdentifier?: string | undefined, documentKey?: string | undefined, documentStatus?: ('CONFIRMED' | 'REJECTED') | undefined, documentType: 'LOGO' | 'MENU' | 'PHOTO' | 'PHOTO_BUILDING' | 'DOCUMENT' | 'BANNER' | 'BANNER_LANDING' | 'BANNER_LANDING_DESKTOP' | 'ID_NATIONAL_CODE' | 'ID_IDENTITY_NUMBER' | 'ID_BUSINESS_LICENSE' | 'ID_SHEBA_CONFIRMATION' | 'ID_POSTAL_CODE' | 'ID_APG_CONTRACT' | 'ID_POS_CONTRACT' | 'ID_ACCEPTOR_CONFIRMATION' | 'ID_OTHERS', id?: number | undefined, makePublic?: boolean | undefined, paymentTool?: PaymentTool | undefined, statusDescription?: string | undefined, uploadedOn: string, validFrom?: string | undefined, validTo?: string | undefined}; export type Facility = {code: string, id?: number | undefined, name: string}; export type AcceptorFacility = {acceptor?: Acceptor | undefined, facility?: Facility | undefined, id?: number | undefined}; export type AcceptorGroup = {department: 'SPORT' | 'CLOTHING' | 'CONSULTING' | 'DIGITAL' | 'RESTAURANT' | 'HEALTH' | 'SCIENCE' | 'STORE' | 'TRAVEL' | 'HOME_APPLIANCE' | 'BEAUTY' | 'JEWELLERY' | 'CULTURE' | 'FORMALITY' | 'ART' | 'CAR' | 'BUILDING', id?: number | undefined, name: string}; export type AcceptorGuild = {code: string, id?: number | undefined, name?: string | undefined}; 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 Ostan = {amarCode: number, id?: number | undefined, name: string, phoneCode?: string | undefined}; export type Shahrestan = {amarCode: number, id?: number | undefined, name: string, ostan: Ostan}; export type Bakhsh = {amarCode: number, id?: number | undefined, name: string, ostan: Ostan, shahrestan: Shahrestan}; export type Shahr = {amarCode: number, bakhsh: Bakhsh, id?: number | undefined, name: string, ostan: Ostan, shahrType?: number | undefined, shahrestan: Shahrestan, shaparakCode?: string | undefined}; export type AcceptorSubGroup = {group: AcceptorGroup, id?: number | undefined, name: string}; export type AcceptorSubGuild = {code: string, guild: AcceptorGuild, id?: number | undefined, name?: string | undefined}; export type TradingHours = {fri?: string | undefined, id?: number | undefined, mon?: string | undefined, name?: string | undefined, publicHolidays?: string | undefined, sat?: string | undefined, sun?: string | undefined, thu?: string | undefined, tue?: string | undefined, wed?: string | undefined}; export type Acceptor = {acceptorName?: string | undefined, acceptorNameEn?: string | undefined, active?: boolean | undefined, address?: string | undefined, addressEn?: string | undefined, anonymousPay?: boolean | undefined, apgCallbackUrl?: string | undefined, apgSecond?: boolean | undefined, birthCertDigit?: string | undefined, birthCertLetter?: string | undefined, birthCertNumber?: string | undefined, birthCertSeriesNumber?: string | undefined, cashoutVip?: boolean | undefined, centerUpdatableByOwner?: boolean | undefined, city?: string | undefined, code?: string | undefined, companyName?: string | undefined, companyNationalId?: string | undefined, contacts?: Array | undefined, contractSignDate?: string | undefined, contractSignDateJalali?: string | undefined, couponCreationFeePercentage?: number | undefined, dateOfBirth?: string | undefined, delivery?: boolean | undefined, department?: ('SPORT' | 'CLOTHING' | 'CONSULTING' | 'DIGITAL' | 'RESTAURANT' | 'HEALTH' | 'SCIENCE' | 'STORE' | 'TRAVEL' | 'HOME_APPLIANCE' | 'BEAUTY' | 'JEWELLERY' | 'CULTURE' | 'FORMALITY' | 'ART' | 'CAR' | 'BUILDING') | undefined, departmentRestaurant?: boolean | undefined, description?: string | undefined, discountPercentage?: number | undefined, documents?: Array | undefined, facilities?: Array | undefined, familyName?: string | undefined, familyNameEn?: string | undefined, fatherName?: string | undefined, gender?: ('MALE' | 'FEMALE') | undefined, givenName?: string | undefined, givenNameEn?: string | undefined, group?: AcceptorGroup | undefined, guild?: AcceptorGuild | undefined, hideUnregisteredUsersForFactor?: boolean | undefined, id?: number | undefined, identityType?: ('PERSON' | 'COMPANY') | undefined, introducerPercentage?: number | undefined, ipgOverrideName?: boolean | undefined, kargozar?: User | undefined, makePublic?: boolean | undefined, maxDistance?: number | undefined, mobile?: string | undefined, nationalIdNumber?: string | undefined, nationality?: ('IRANIAN' | 'FOREIGNER') | undefined, noRawFee?: boolean | undefined, notifySdkPaymentUrl?: boolean | undefined, onboarded?: boolean | undefined, onlineShop?: boolean | undefined, ostan?: Ostan | undefined, parent?: Acceptor | undefined, paymentTools?: Array | undefined, phone?: string | undefined, pickup?: boolean | undefined, pickupGap?: number | undefined, platformDiscountPercentage?: number | undefined, postcode?: string | undefined, rank?: number | undefined, rawFee?: boolean | undefined, rawFeeFixed?: boolean | undefined, rawFeePercentage?: number | undefined, referralCode?: number | undefined, registrar?: User | undefined, registrarType?: ('USER' | 'OWNER' | 'EMPLOYEE') | undefined, registrationDate?: string | undefined, registrationNumber?: string | undefined, shahr?: Shahr | undefined, shortDescription?: string | undefined, siteUrl?: string | undefined, soldSum?: number | undefined, state?: string | undefined, status?: ('REQUESTED' | 'CONFIRMED' | 'DOCUMENT_INCOMPLETE' | 'DOCUMENT_CONFIRMED' | 'DOCUMENT_SENT' | 'NEEDTOREVIEW' | 'COMPLETE_PROFILE' | 'ACTIVE' | 'INACTIVE' | 'SYSTEM' | 'EXPIRED' | 'NOTRANSACTION' | 'CLOSED' | 'ORGANIZATIONAL' | 'BUILDING') | undefined, storeType?: ('VIRTUAL' | 'PHYSICAL') | undefined, subGroup?: AcceptorSubGroup | undefined, subGuild?: AcceptorSubGuild | undefined, tables?: boolean | undefined, targetGroup?: ('MALE' | 'FEMALE' | 'UNISEX') | undefined, tax?: boolean | undefined, taxCode?: string | undefined, taxRaw?: boolean | undefined, terminalSecond?: boolean | undefined, terminalSecondId?: string | undefined, tradingHours?: TradingHours | undefined, user?: User | undefined, visible?: boolean | undefined}; export type WalletPayBillCommand = {acceptor?: Acceptor | undefined, acceptorCode?: string | undefined, amount: number, billId?: string | undefined, payId?: string | undefined, user?: User | undefined}; export type CreateApiApiWalletPayBillArgs = {body: WalletPayBillCommand}; export type CreateApiApiWalletPayBillOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * payBill * * POST /api/wallet/pay/bill */ export const createApiApiWalletPayBill = async (args: CreateApiApiWalletPayBillArgs, options: CreateApiApiWalletPayBillOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/wallet/pay/bill${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 };