node-nestpay-v3
Version:
A Node.js wrapper for the NestPay V3 API
19 lines (17 loc) • 584 B
JavaScript
;
module.exports = function (nestpay) {
nestpay.prototype.void = function (value = {}) {
var that = this;
return new Promise(function (resolve, reject) {
var data = {
Name: that.config.name,
Password: that.config.password,
ClientId: that.config.clientId,
Type: 'Void',
OrderId: value.orderId
};
var url = that.config.endpoints[that.config.endpoint];
that.request(url, data).then(resolve).catch(reject);
});
}
}