export type GetApiApiPublicV1PaymentNewReferralCodeArgs = {a?: number | undefined, m?: string | undefined, n?: string | undefined, referralCode: string}; export type GetApiApiPublicV1PaymentNewReferralCodeOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * paymentNew * * GET /api/public/v1/payment/new/{referralCode} */ export const getApiApiPublicV1PaymentNewReferralCode = async (args: GetApiApiPublicV1PaymentNewReferralCodeArgs, options: GetApiApiPublicV1PaymentNewReferralCodeOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.a != null) query.append("a", String(args.a)) if (args.m != null) query.append("m", String(args.m)) if (args.n != null) query.append("n", String(args.n)) const url = `${baseUrl.replace(/\/+$/, '')}/api/public/v1/payment/new/${encodeURIComponent(String(args.referralCode))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };