UNPKG

checkbook-api-ts

Version:

Node.js library for the Checkbook.io API in TS

63 lines (55 loc) 1.75 kB
import { Resource } from "../resource"; export class Check { /** * */ constructor(private readonly resource: Resource) { } list(query, callback: (err, response) => void) { return this.resource.request({ method: 'GET', uri: '/check', qs: query }, callback); } get(check_id, callback: (err, response) => void) { return this.resource.request({ method: 'GET', uri: '/check/' + check_id }, callback); } delete(check_id, callback: (err, response) => void) { return this.resource.request({ method: 'DELETE', uri: '/check/' + check_id }, callback); } sendDigitalCheck(params, callback: (err, response) => void, idempotencyKey?) { return this.resource.request({ method: 'POST', uri: '/check/digital', body: params }, callback, idempotencyKey); } sendPhysicalCheck(params, callback: (err, response) => void, idempotencyKey?) { return this.resource.request({ method: 'POST', uri: '/check/physical', body: params }, callback, idempotencyKey); } sendDirectCheck(params, callback: (err, response) => void, idempotencyKey?) { return this.resource.request({ method: 'POST', uri: '/check/direct', body: params }, callback, idempotencyKey); } sendMultipleChecksCSV(params, callback: (err, response) => void, idempotencyKey?) { return this.resource.request({ method: 'POST', uri: '/check/csv', body: params }, callback, idempotencyKey); } }