svb-cards
v1.3.2
Published
Generating Virtual Cards using the Silicon Valley Bank API
Downloads
4
Readme
svb-cards
A NodeJS helper library to create, cancel, and retrieve records of virtual debit cards.
Uses SVB-Client module and your API credentials.
Usage
let client = new SVBClient({
API_KEY: '',
HMAC_SECRET: ''
});
let SVBCard = new SVBCards(client);
// create and retrieve virtual card
// showCardNumber is true or false
SVBCard.create({ cardData }, showCardNumber, (err, response) => {
console.log(response);
});
SVBCard.get(cardID, showCardNumber, callback);
// patch update
SVBCard.update(cardID, { cardData }, showCardNumber, callback);
// send an email to someone with their card details
SVBCard.email(cardID, '[email protected]', callback);
// cancel
SVBCard.cancel(cardID, callback);
// getting a list of cards
SVBCard.all({}, 0, 0, (err, response) => {
// response.data is an array of cards
});
// using metadata filters (e.g. metadata.purchase_nunber)
SVBCard.find({ purchase_nunber: 101 }, 0, 0, (err, response) => {
// response.data is an array of cards
});
// using pagination
SVBCard.find({ ... }, startCursor, limit, (err, response) => {
// response.data is an array of cards
// response.links.first is the first page of results
// response.links.next moves cursor to the next page of results
// e.g. "/v1/virtualcards?page[cursor]=87285"
});
Installation
npm install svb-cards --save