import { AxiosResponse } from 'axios'; import * as deepmerge from 'deepmerge'; import { AbstractFacade, IFacadeConfig, IFacadeInterceptors } from 'platform-common/dist/client'; // full path to work in the browser export class VendorOrderFacade extends AbstractFacade { constructor(config?: IFacadeConfig, interceptors: IFacadeInterceptors = {}) { super( deepmerge.all([ { axiosConfig: { baseURL: process.env.GOPARROT_PLATFORM_SERVICE_VENDOR_V2 as string, }, }, config || {}, ]), interceptors, ); } /** * @param {string} orderId * @return {Promise>} * @throws {AxiosError} */ async refund(orderId: string): Promise> { return this.client.patch(`/api/v2/orders/${orderId}/refund`); } }