UNPKG

bc-checkout-sdk

Version:

BetterCommerce's Checkout NodeJS SDK enables BC client applications to integrate with Checkout merchant API system. It publishes an interface to interact with [Checkout API](https://api-reference.checkout.com/#operation/getPaymentDetails/) endpoints.

16 lines (15 loc) 900 B
/** * This function makes a request to the Checkout.com 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 `CheckoutEnvironment.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;