payrex-node
Version:
PayRex Node JS Library
31 lines (25 loc) • 757 B
JavaScript
const BaseService = require('./BaseService');
const PaymentEntity = require('../entities/PaymentEntity');
function PaymentService(client) {
BaseService.call(this, client);
this.path = 'payments';
}
PaymentService.prototype.retrieve = function (id) {
return this.request({
path: `${this.path}/${id}`,
method: 'get',
}).then(function (response) {
return new PaymentEntity(response);
});
};
PaymentService.prototype.update = function (id, payload) {
return this.request({
path: `${this.path}/${id}`,
payload: payload,
method: 'put',
}).then(function (response) {
return new PaymentEntity(response);
});
};
Object.setPrototypeOf(PaymentService.prototype, BaseService.prototype);
module.exports = PaymentService;