forked from Mangopay/mangopay2-nodejs-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BankAccounts.js
31 lines (26 loc) · 986 Bytes
/
BankAccounts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* @module BankAccounts
*/
var Service = require('../service');
var Transaction = require('../models/Transaction');
var BankAccounts = Service.extend({
/**
* Retrieve list of transactions for a bank account
* @param {number} bankAccountId Bank Account Id
* @param {Function} callback Callback function
* @param {Object} options Request options
* @return {Object} Request promise
*/
getTransactions: function (bankAccountId, callback, options) {
if (options && !options.hasOwnProperty('parameters'))
Object.assign(options, {parameters: {...options}});
options = this._api._getOptions(callback, options, {
path: {
bankAccountId: bankAccountId
},
dataClass: Transaction
});
return this._api.method('transactions_get_for_bank_account', callback, options);
}
});
module.exports = BankAccounts;