From 4c9b80482b683185394b1d1c7f1fab398434a645 Mon Sep 17 00:00:00 2001 From: Omar Baqueiro Date: Mon, 13 Aug 2018 12:44:17 -0500 Subject: [PATCH] Add support to get list of Institutions --- index.js | 6 ++++-- lib/Institutions.js | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 lib/Institutions.js diff --git a/index.js b/index.js index 384bbd6..36dcdeb 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,8 @@ var Clients = require('./lib/Clients.js'), Node = require('./lib/Node.js'), Transactions = require('./lib/Transactions.js'), Transaction = require('./lib/Transaction.js'), - Helpers = require('./lib/Helpers.js'); + Helpers = require('./lib/Helpers.js'), + Institutions = require ('./lib/Institutions.js'); module.exports = { Clients: Clients, @@ -15,5 +16,6 @@ module.exports = { Node: Node, Transactions: Transactions, Transaction: Transaction, - Helpers: Helpers + Helpers: Helpers, + Institutions: Institutions }; diff --git a/lib/Institutions.js b/lib/Institutions.js new file mode 100644 index 0000000..56a5d97 --- /dev/null +++ b/lib/Institutions.js @@ -0,0 +1,19 @@ +const APIClient = require('./APIClient.js'); + +const Institutions = { + get(client, callback) { + const config = { + client: client + }; + path = '/institutions'; + APIClient.get(client.baseUrl + path, config, (err, json) => { + if (err) { + callback(err); + } else { + callback(null, json); + } + }); + } +} + +module.exports = Institutions;