checkbook-api
Version:
Node.js library for the Checkbook.io API
66 lines (54 loc) • 1.62 kB
JavaScript
;
function Check(resource) {
this.resource = resource;
}
Check.prototype = {
list: function(query, callback) {
return this.resource.request({
method: 'GET',
uri: '/check',
qs: query
}, callback);
},
get: function(check_id, callback) {
return this.resource.request({
method: 'GET',
uri: '/check/' + check_id
}, callback);
},
delete: function(check_id, callback) {
return this.resource.request({
method: 'DELETE',
uri: '/check/' + check_id
}, callback);
},
sendDigitalCheck: function(params, callback, idempotencyKey) {
return this.resource.request({
method: 'POST',
uri: '/check/digital',
body: params
}, callback, idempotencyKey);
},
sendPhysicalCheck: function(params, callback, idempotencyKey) {
return this.resource.request({
method: 'POST',
uri: '/check/physical',
body: params
}, callback, idempotencyKey);
},
sendDirectCheck: function(params, callback, idempotencyKey) {
return this.resource.request({
method: 'POST',
uri: '/check/direct',
body: params
}, callback, idempotencyKey);
},
sendMultipleChecksCSV: function(params, callback, idempotencyKey) {
return this.resource.request({
method: 'POST',
uri: '/check/csv',
body: params
}, callback, idempotencyKey);
}
};
module.exports = Check;