forked from socialmoney/corepro-sdk-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatement.js
More file actions
41 lines (35 loc) · 1.42 KB
/
statement.js
File metadata and controls
41 lines (35 loc) · 1.42 KB
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
32
33
34
35
36
37
38
39
40
41
/**
* Created by socialmoneydev on 9/1/2014.
*/
var Requestor = require('./utils/requestor');
var FileContent = require('./models/filecontent');
var Statement = function() {
var self = this;
self.requestId = null;
self.statementId = null;
self.customerId = null;
self.type = null;
self.month = null;
self.year = null;
self.get = function(customerId, statementId, callback, connection, loggingObject){
customerId = customerId || self.customerId;
statementId = statementId || self.statementId;
new Requestor().get('/statement/get/' + customerId + '/' + statementId, Statement, function(ex, data){
callback(ex, data);
}, connection, loggingObject);
};
self.list = function(customerId, callback, connection, loggingObject){
customerId = customerId || self.customerId;
new Requestor().get('/statement/list/' + customerId, Statement, function(ex, data){
callback(ex, data);
}, connection, loggingObject);
};
self.download = function(customerId, statementId, callback, connection, loggingObject){
customerId = customerId || self.customerId;
statementId = statementId || self.statementId;
new Requestor().get('/statement/download/' + customerId + '/' + statementId, FileContent, function(ex, data){
callback(ex, data);
}, connection, loggingObject);
};
};
module.exports = Statement;