export type InvoiceExtraInfoCommand = {acceptorCode?: string | undefined, amount?: number | undefined, customerLogin?: string | undefined, description?: string | undefined, invoiceNumber?: number | undefined, invoiceType?: ('PURCHASED_PLAN' | 'DEPOSITE_TO_WALLET' | 'ADD_CARD') | undefined, ipgCompany?: ('SEPEHR' | 'FANAVA' | 'NOVIN' | 'SAMAN' | 'IKC' | 'ASAN') | undefined, originalCommand?: string | undefined, originalCommandType?: ('MOBILE_CHARGE' | 'INTERNET_CHARGE' | 'AYRIA_PAYMENT' | 'PURCHASE_SCORE' | 'PURCHASE' | 'WALLET_TRANSFER') | undefined, referralCode?: number | undefined, tip?: number | undefined, token?: string | undefined, zifiRedirectUrl?: string | undefined}; export type DefaultPaymentCommand = {amount?: number | undefined, asanPayment?: boolean | undefined, cardExpireDate?: string | undefined, cardNumber?: string | undefined, fanavaPayment?: boolean | undefined, ikcPayment?: boolean | undefined, invoiceExtraInfo?: InvoiceExtraInfoCommand | undefined, invoiceNumber?: number | undefined, maskedCardNumber?: string | undefined, message?: string | undefined, novinPayment?: boolean | undefined, referralCode?: number | undefined, samanPayment?: boolean | undefined, sepehrPayment?: boolean | undefined, terminal?: string | undefined}; export type CreateApiApiAccountPlanBasicArgs = {body: DefaultPaymentCommand}; export type CreateApiApiAccountPlanBasicOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * assignBasicPlan * * POST /api/account/plan/basic */ export const createApiApiAccountPlanBasic = async (args: CreateApiApiAccountPlanBasicArgs, options: CreateApiApiAccountPlanBasicOptions) => { 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/account/plan/basic${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() };