banking
Advanced tools
Comparing version 0.3.0 to 0.3.2
@@ -34,3 +34,3 @@ | ||
fid: args.fid, | ||
fidorg: args.fidOrg || '', | ||
fidOrg: args.fidOrg || '', | ||
url: args.url, | ||
@@ -41,2 +41,3 @@ bankId: args.bankId || '', /* If bank account use your bank routing number otherwise set to null */ | ||
accId: args.accId, /* Account Number */ | ||
brokerId: args.brokerId, /* For investment accounts */ | ||
accType: args.accType, | ||
@@ -43,0 +44,0 @@ appVer: args.appVer || '1700', |
@@ -15,2 +15,33 @@ | ||
function getSignOnMsg(opts) { | ||
return '<SIGNONMSGSRQV1>' + | ||
'<SONRQ>' + | ||
'<DTCLIENT>' + opts.end + | ||
'<USERID>' + opts.user + | ||
'<USERPASS>' + opts.password + | ||
'<LANGUAGE>ENG' + | ||
'<FI>' + | ||
'<ORG>' + opts.fidOrg + | ||
'<FID>' + opts.fid + | ||
'</FI>' + | ||
'<APPID>' + opts.app + | ||
'<APPVER>' + opts.appVer + | ||
'</SONRQ>' + | ||
'</SIGNONMSGSRQV1>'; | ||
} | ||
function getOfxHeaders(opts) { | ||
return 'OFXHEADER:100\n' + | ||
'DATA:OFXSGML\n' + | ||
'VERSION:'+opts.ofxVer+'\n' + | ||
'SECURITY:NONE\n' + | ||
'ENCODING:USASCII\n' + | ||
'CHARSET:1252\n' + | ||
'COMPRESSION:NONE\n' + | ||
'OLDFILEUID:NONE\n' + | ||
'NEWFILEUID:' + util.uuid(32) + '\n' + | ||
'\n'; | ||
} | ||
/** | ||
@@ -26,19 +57,32 @@ * [createRequest description] | ||
//Request for Bank statement | ||
if (type === 'INVESTMENT') { | ||
var reqStr = getOfxHeaders(opts) + | ||
'<OFX>' + | ||
getSignOnMsg(opts) + | ||
'<INVSTMTMSGSRQV1>' + | ||
'<INVSTMTTRNRQ>' + | ||
'<TRNUID>' + util.uuid(32) + | ||
'<CLTCOOKIE>' + util.uuid(5) + | ||
'<INVSTMTRQ>' + | ||
'<INVACCTFROM>' + | ||
'<BROKERID>' + opts.brokerId + | ||
'<ACCTID>' + opts.accId + | ||
'</INVACCTFROM>' + | ||
'<INCTRAN>' + | ||
'<DTSTART>' + opts.start + | ||
'<INCLUDE>Y</INCTRAN>' + | ||
'<INCOO>Y' + | ||
'<INCPOS>' + | ||
'<INCLUDE>Y' + | ||
'</INCPOS>' + | ||
'<INCBAL>Y' + | ||
'</INVSTMTRQ>' + | ||
'</INVSTMTTRNRQ>' + | ||
'</INVSTMTMSGSRQV1>' + | ||
'</OFX>'; | ||
} else | ||
if (type != 'CREDITCARD') { | ||
var reqStr = 'OFXHEADER:100\n' + | ||
'DATA:OFXSGML\nVERSION:'+opts.ofxVer+'\nSECURITY:NONE\nENCODING:USASCII\nCHARSET:1252\nCOMPRESSION:NONE\nOLDFILEUID:NONE\nNEWFILEUID:' + util.uuid(32) + '\n\n' + | ||
var reqStr = getOfxHeaders(opts) + | ||
'<OFX>' + | ||
'<SIGNONMSGSRQV1>' + | ||
'<SONRQ>' + | ||
'<DTCLIENT>' + opts.end + | ||
'<USERID>' + opts.user + | ||
'<USERPASS>' + opts.password + | ||
'<LANGUAGE>ENG' + | ||
'<FI>' + | ||
'<ORG>' + opts.fidorg + | ||
'<FID>' + opts.fid + | ||
'</FI>' + | ||
'<APPID>' + opts.app + | ||
'<APPVER>' + opts.appVer + | ||
'</SONRQ></SIGNONMSGSRQV1>' + | ||
getSignOnMsg(opts) + | ||
'<BANKMSGSRQV1>' + | ||
@@ -56,2 +100,3 @@ '<STMTTRNRQ>' + | ||
'<DTSTART>' + opts.start + | ||
(typeof opts.end !== 'undefined' ? '<DTEND>' + opts.end : '') + | ||
'<INCLUDE>Y</INCTRAN>' + | ||
@@ -64,18 +109,5 @@ '</STMTRQ>' + | ||
//Request for CreditCard Statement | ||
var reqStr = 'OFXHEADER:100\n' + | ||
'DATA:OFXSGML\nVERSION:'+opts.ofxVer+'\nSECURITY:NONE\nENCODING:USASCII\nCHARSET:1252\nCOMPRESSION:NONE\nOLDFILEUID:NONE\nNEWFILEUID:' + util.uuid(32) + '\n\n' + | ||
var reqStr = getOfxHeaders(opts) + | ||
'<OFX>' + | ||
'<SIGNONMSGSRQV1>' + | ||
'<SONRQ>' + | ||
'<DTCLIENT>' + opts.end + | ||
'<USERID>' + opts.user + | ||
'<USERPASS>' + opts.password + | ||
'<LANGUAGE>ENG' + | ||
'<FI>' + | ||
'<ORG>' + opts.fidOrg + | ||
'<FID>' + opts.fid + | ||
'</FI>' + | ||
'<APPID>' + opts.app + | ||
'<APPVER>' + opts.appVer + | ||
'</SONRQ></SIGNONMSGSRQV1>' + | ||
getSignOnMsg(opts) + | ||
'<CREDITCARDMSGSRQV1>' + | ||
@@ -82,0 +114,0 @@ '<CCSTMTTRNRQ>' + |
{ | ||
"name": "banking", | ||
"description": "The missing Bank API for getting you statement data", | ||
"version": "0.3.0", | ||
"version": "0.3.2", | ||
"author": "Christian Sullivan <cs@euforic.co>", | ||
@@ -16,5 +16,5 @@ "keywords": [ | ||
"dependencies": { | ||
"xml2json": "~0.3.2", | ||
"debug": "~0.7.4", | ||
"superagent": "~0.15.7" | ||
"xml2json": "^0.4.0", | ||
"debug": "^0.8.0", | ||
"superagent": "^0.17.0" | ||
}, | ||
@@ -35,4 +35,4 @@ "devDependencies": { | ||
"engines": { | ||
"node": ">= 0.6.2" | ||
"node": ">= 0.8.0" | ||
} | ||
} |
# [Banking.js](http://euforic.co/banking.js) | ||
Version 0.3.0 | ||
Version 0.3.2 | ||
[![Build Status](https://secure.travis-ci.org/euforic/banking.js.png)](http://travis-ci.org/euforic/banking.js) | ||
[![NPM version](https://badge.fury.io/js/banking.png)](https://npmjs.org/package/banking) | ||
[![Gittip](http://img.shields.io/gittip/euforic.png)](https://www.gittip.com/euforic/) | ||
## Breaking changes! | ||
@@ -72,3 +72,3 @@ see docs below | ||
// date format YYYYMMDDHHMMSS | ||
bank.getStatement({start:20130101, end:20131101} function(err, res){ | ||
bank.getStatement({start:20130101, end:20131101}, function(err, res){ | ||
if(err) console.log(err) | ||
@@ -222,3 +222,3 @@ console.log(res); | ||
Copyright (c) 2013 Christian Sullivan <cs@euforic.co> | ||
Copyright (c) 2014 Christian Sullivan <cs@bodhi5.com> | ||
@@ -225,0 +225,0 @@ Permission is hereby granted, free of charge, to any person obtaining |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
16152
284
0
+ Addeddebug@0.8.1(transitive)
+ Addedextend@1.2.1(transitive)
+ Addednan@0.6.0(transitive)
+ Addednode-expat@2.1.4(transitive)
+ Addedsuperagent@0.17.0(transitive)
+ Addedxml2json@0.4.0(transitive)
- Removednode-expat@2.0.0(transitive)
- Removedsuperagent@0.15.7(transitive)
- Removedxml2json@0.3.2(transitive)
Updateddebug@^0.8.0
Updatedsuperagent@^0.17.0
Updatedxml2json@^0.4.0