export type QPilotCoreModelsPaymentMethodType = 'Stripe' | 'AuthorizeNet' | 'Test' | 'PayPal' | 'Braintree' | 'CyberSource' | 'Undefined' | 'Other' | 'Nmi' | 'PayaV1' | 'TrustCommerce' | 'Square' | 'Sage' | 'CyberSourceV2' | 'Checkout' | 'PaypalV2' | 'Shopify' | 'PayPalV3' | 'Airwallex'; export type QPilotCoreModelsDtoRequestsPostPutPaymentIntegrationDto = {paymentMethodType: QPilotCoreModelsPaymentMethodType, apiAccount?: (string | null) | undefined, apiKey1?: (string | null) | undefined, apiKey2?: (string | null) | undefined, apiKey3?: (string | null) | undefined, testMode?: boolean | undefined, authorizeOnly?: boolean | undefined}; export type CreateApiSitesSiteIdPaymentIntegrationsArgs = {siteId: number, body: QPilotCoreModelsDtoRequestsPostPutPaymentIntegrationDto}; export type CreateApiSitesSiteIdPaymentIntegrationsOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create Payment Integration * * POST /Sites/{siteId}/PaymentIntegrations */ export const createApiSitesSiteIdPaymentIntegrations = async (args: CreateApiSitesSiteIdPaymentIntegrationsArgs, options?: CreateApiSitesSiteIdPaymentIntegrationsOptions) => { const {baseUrl = "https://api.qpilot.cloud", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/Sites/${encodeURIComponent(String(args.siteId))}/PaymentIntegrations${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 };