UNPKG

payrex-node

Version:
32 lines (26 loc) 762 B
const BaseService = require('./BaseService'); const RefundEntity = require('../entities/RefundEntity'); function RefundService(client) { BaseService.call(this, client); this.path = 'refunds'; } RefundService.prototype.create = function (payload) { return this.request({ path: this.path, payload: payload, method: 'post', }).then(function (response) { return new RefundEntity(response); }); }; RefundService.prototype.update = function (id, payload) { return this.request({ path: `${this.path}/${id}`, payload: payload, method: 'put', }).then(function (response) { return new RefundEntity(response); }); }; Object.setPrototypeOf(RefundService.prototype, BaseService.prototype); module.exports = RefundService;