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' | 'PAYSTAR' | 'APG_CLIENT') | 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 CreateApiApiInvoiceExtraInfoArgs = {body: InvoiceExtraInfoCommand}; export type CreateApiApiInvoiceExtraInfoOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * extraInfo * * POST /api/invoice/extra-info */ export const createApiApiInvoiceExtraInfo = async (args: CreateApiApiInvoiceExtraInfoArgs, options: CreateApiApiInvoiceExtraInfoOptions) => { 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/invoice/extra-info${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() };