bc-opayo-sdk
Version:
BetterCommerce's Opayo NodeJS SDK enables BC client applications to integrate with Opayo merchant API system. It publishes an interface to interact with [Opayo API](https://www.elavon.co.uk/resource-center/help-with-your-solutions/opayo/integrations/types
16 lines (15 loc) • 890 B
TypeScript
/**
* This function makes a request to the Opayo API and handles the response.
*
* @param {string} url - The URL of the API endpoint.
* @param {string} method - The HTTP method to use. Defaults to 'post'.
* @param {object} data - The data to send in the request body.
* @param {object} params - The URL parameters to send with the request.
* @param {object} headers - The headers to send with the request.
* @param {object} cookies - The cookies to send with the request.
* @param {string} baseUrl - The base URL of the API. Defaults to the value of `OpayoEnvironment.getBaseUrl()`.
*
* @returns {Promise<object | { hasError: true, error: any }>} - A promise that resolves to the response data or an object with an error property.
*/
declare const fetcher: ({ url, method, data, params, headers, cookies, baseUrl, }: any) => Promise<any>;
export default fetcher;