1.3.2 • Published 7 years ago

svb-cards v1.3.2

Weekly downloads
7
License
MIT
Repository
-
Last release
7 years ago

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, 'janet@example.com', 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

1.3.2

7 years ago

1.3.1

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago