import Client from './client'; export default class Orders extends Client { constructor(opts) { let options = opts; if (typeof opts === 'string') { options = { host: opts }; // convert host string to options object } options.serviceName = 'order'; super(options); } getByNumber(merchantId, number, options = {}) { return this.makeRequest(`${this.host}/${merchantId}/orders/${number}`, options); } post(merchantId, options = {}) { return this.makeRequest(`${this.host}/${merchantId}/orders`, { ...options, method: 'POST', }); } putByNumber(merchantId, number, options = {}) { return this.makeRequest(`${this.host}/${merchantId}/orders/${number}`, { ...options, method: 'PUT', }); } delete(merchantId, options = {}) { return this.makeRequest(`${this.host}/${merchantId}/orders`, { ...options, method: 'DELETE', }); } }