export type CreateApiMerchantidMerchantIdProviderkeyAnywherecommerceArgs = {merchantId: string, providerKey: string, body: {enabled?: boolean | undefined, tip?: ({allow?: boolean | undefined, allowCustom?: boolean | undefined, options?: (Array<{rate?: ({value?: number | undefined, isPercentage?: boolean | undefined}) | undefined}>) | undefined}) | undefined, entryModes?: ({swipe?: boolean | undefined, insert?: boolean | undefined, tap?: boolean | undefined, pinpad?: boolean | undefined}) | undefined, paymentMethods?: ({credit?: boolean | undefined, debit?: boolean | undefined}) | undefined, defaultModel?: string | undefined, name?: string | undefined, description?: string | undefined, status?: string | undefined}}; export type CreateApiMerchantidMerchantIdProviderkeyAnywherecommerceOptions = {baseUrl?: string | undefined, sec0?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Create Terminal - AnywhereCommerce * * POST /merchantid/{merchantId}/providerkey/anywherecommerce */ export const createApiMerchantidMerchantIdProviderkeyAnywherecommerce = async (args: CreateApiMerchantidMerchantIdProviderkeyAnywherecommerceArgs, options?: CreateApiMerchantidMerchantIdProviderkeyAnywherecommerceOptions) => { const {baseUrl = "https://sandbox.api.mxmerchant.com/checkout", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (sec0 !== undefined) headers.set('authorization', `Basic ${btoa(`${sec0.username}:${sec0.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/merchantid/${encodeURIComponent(String(args.merchantId))}/providerkey/anywherecommerce${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 };