/** * State object returned by flutterwave API * @typedef {Object} FlutterwaveState * @property data - the parsed response body from flutterwave * @property response - the full response from the flutterwave server, including headers, statusCode, body, etc * @property references - an array of all previous data objects used in the Job **/ /** * Options provided to the Flutterwave requests * @typedef {Object} RequestOptions * @public * @property {object} errors - Map of errorCodes -> error messages, ie, `{ 404: 'Resource not found;' }`. Pass `false` to suppress errors for this code. * @property {object} form - Pass a JSON object to be serialised into a multipart HTML form (as FormData) in the body. * @property {object} query - An object of query parameters to be encoded into the URL. * @property {object} headers - An object of headers to append to the request. * @property {string} parseAs - Parse the response body as json, text or stream. By default will use the response headers. * @property {number} timeout - Request timeout in ms. Default: 300 seconds. */ /** * Create a new customer in Flutterwave. * @function * @public * @param {Object} customerData * @param {RequestOptions} [options] - Optional request options * @returns {Function} */ export function createCustomer(customerData: any, options?: RequestOptions): Function; /** * Initiate a payment request to the Flutterwave API. * @function * @public * @param {Object} paymentData - The payment details to send to Flutterwave. * @param {RequestOptions} [options] - Optional request options * @returns {Function} - A function that takes the state and performs the operation. */ export function initiatePayment(paymentData: any, options?: RequestOptions): Function; /** * Create a new payment method in Flutterwave. * @function * @public * @param {Object} paymentMethodData - The payment method details to send to Flutterwave. * @param {RequestOptions} [options] - Optional request options * @returns {Function} - A function that takes the state and performs the operation. */ export function createPaymentMethod(paymentMethodData: any, options?: RequestOptions): Function; /** * State object returned by flutterwave API */ export type FlutterwaveState = { /** * - the parsed response body from flutterwave */ data: any; /** * - the full response from the flutterwave server, including headers, statusCode, body, etc */ response: any; /** * - an array of all previous data objects used in the Job */ references: any; }; /** * Options provided to the Flutterwave requests */ export type RequestOptions = any;