UNPKG

bc-clearpay-sdk

Version:

BetterCommerce's ClearPay NodeJS SDK enables BC client applications to integrate with ClearPay merchant API system. It publishes an interface to interact with [ClearPay API v2](https://developers.clearpay.co.uk/clearpay-online/reference) endpoints.

23 lines (22 loc) 1.31 kB
/** * Makes a HTTP request using the specified parameters and returns the response. * Utilizes Axios instance with pre-configured authentication and base URL. * * @param {Object} options - Options for the HTTP request. * @param {string} options.url - The endpoint URL to be requested. * @param {string} options.method - The HTTP method to be used (default: 'post'). * @param {Object} options.data - The request payload for POST requests. * @param {Object} options.params - The query parameters for GET requests. * @param {Object} options.headers - Custom headers to be sent with the request. * @param {Object} options.cookies - Cookies to be sent with the request. * @param {string} options.baseUrl - Optional base URL to override the default. * * @returns {Promise<any>} - Resolves with the response body if the request is successful. * Resolves with an error object if the request fails. * * @throws {InvalidRequestException} - When the request results in a 400 or 404 error. * @throws {AuthenticationException} - When the request results in a 401 error. * @throws {APIException} - For other server-side errors. */ declare const fetcher: ({ url, method, data, params, headers, cookies, baseUrl, }: any) => Promise<any>; export default fetcher;