/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Mercoa from "../../../index.js"; export declare namespace Calculate { interface Options { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; token: core.Supplier; /** Override the X-API-Version header */ xApiVersion?: "2024-08-01"; /** Additional headers to include in requests. */ headers?: Record | undefined>; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Additional query string parameters to include in the request. */ queryParams?: Record; /** Additional headers to include in the request. */ headers?: Record | undefined>; /** Override the X-API-Version header */ xApiVersion?: "2024-08-01"; } } export declare class Calculate { protected readonly _options: Calculate.Options; constructor(_options: Calculate.Options); /** * Calculate the estimated fees associated with an payment given the amount, payment source, and disbursement method. Can be used to calculate fees for a payment before creating an invoice. * * @param {Mercoa.CalculateFeesRequest} request * @param {Calculate.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Mercoa.BadRequest} * @throws {@link Mercoa.Unauthorized} * @throws {@link Mercoa.Forbidden} * @throws {@link Mercoa.NotFound} * @throws {@link Mercoa.Conflict} * @throws {@link Mercoa.InternalServerError} * @throws {@link Mercoa.Unimplemented} * * @example * await client.calculate.fee({ * amount: 100, * paymentSourceId: "pm_4794d597-70dc-4fec-b6ec-c5988e759769", * paymentDestinationId: "pm_4794d597-70dc-4fec-b6ec-c5988e759769" * }) */ fee(request: Mercoa.CalculateFeesRequest, requestOptions?: Calculate.RequestOptions): core.HttpResponsePromise; private __fee; /** * Calculate the estimated payment timing given the deduction date, payment source, and disbursement method. Can be used to calculate timing for a payment. * * @param {Mercoa.CalculatePaymentTimingRequest} request * @param {Calculate.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Mercoa.BadRequest} * @throws {@link Mercoa.Unauthorized} * @throws {@link Mercoa.Forbidden} * @throws {@link Mercoa.NotFound} * @throws {@link Mercoa.Conflict} * @throws {@link Mercoa.InternalServerError} * @throws {@link Mercoa.Unimplemented} * * @example * await client.calculate.paymentTiming({ * estimatedDeductionDate: new Date("2024-01-02T00:00:00.000Z"), * paymentSourceId: "pm_4794d597-70dc-4fec-b6ec-c5988e759769", * paymentDestinationId: "pm_4794d597-70dc-4fec-b6ec-c5988e759769" * }) * * @example * await client.calculate.paymentTiming({ * invoiceId: "in_26e7b5d3-a739-4b23-9ad9-6aaa085f47a9" * }) */ paymentTiming(request: Mercoa.CalculatePaymentTimingRequest, requestOptions?: Calculate.RequestOptions): core.HttpResponsePromise; private __paymentTiming; protected _getAuthorizationHeader(): Promise; }