|
| 1 | +# Banking.js |
| 2 | + |
| 3 | +## The Missing API for your bank. |
| 4 | + * Bank statement results in JSON or Valid XML |
| 5 | + * Supports all financial institutions (File an issue if yours does not work) |
| 6 | + |
| 7 | +## Installation |
| 8 | + |
| 9 | +```bash |
| 10 | +$ npm install banking |
| 11 | +``` |
| 12 | + |
| 13 | +## Usage |
| 14 | + |
| 15 | +```javascript |
| 16 | +var banking = require('banking'); |
| 17 | + |
| 18 | +var bankInfo = { |
| 19 | + fid: 10898 |
| 20 | + , fidorg: 'B1' |
| 21 | + , url: 'https://yourBanksOfxApiURL.com' |
| 22 | + , bankid: 0123456 /* If bank account use your bank routing number otherwise set to null */ |
| 23 | + , user: username |
| 24 | + , pass: password |
| 25 | + , accid: 0123456789 |
| 26 | + , acctype: 'CHECKING' /* CHECKING || SAVINGS || MONEYMRKT || CREDITCARD */ |
| 27 | + , date_start: 20010125 /* Statement start date YYYYMMDDHHMMSS */ |
| 28 | + , date_end: 20110125 /* Statement end date YYYYMMDDHHMMSS */ |
| 29 | +}; |
| 30 | + |
| 31 | +//If second param is omitted JSON will be returned by default |
| 32 | + |
| 33 | +banking.getStatement(bankInfo, 'xml', function(res, err) |
| 34 | + if(err) console.log(err) |
| 35 | + console.log(res); |
| 36 | +} |
| 37 | +``` |
| 38 | +## Sample Response |
| 39 | +
|
| 40 | +```javascript |
| 41 | +{ |
| 42 | + "OFX": { |
| 43 | + "SIGNONMSGSRSV1": { |
| 44 | + "SONRS": { |
| 45 | + "STATUS": { |
| 46 | + "CODE": "0", |
| 47 | + "SEVERITY": "INFO", |
| 48 | + "MESSAGE": "SUCCESS" |
| 49 | + }, |
| 50 | + "DTSERVER": "20120126212302.454[-8:PST]", |
| 51 | + "LANGUAGE": "ENG", |
| 52 | + "FI": { |
| 53 | + "ORG": "DI", |
| 54 | + "FID": "321081669" |
| 55 | + } |
| 56 | + } |
| 57 | + }, |
| 58 | + "BANKMSGSRSV1": { |
| 59 | + "STMTTRNRS": { |
| 60 | + "TRNUID": "BiJNgqjvbw5vg18Z5T8kZASgUKmsFnNY", |
| 61 | + "STATUS": { |
| 62 | + "CODE": "0", |
| 63 | + "SEVERITY": "INFO", |
| 64 | + "MESSAGE": "SUCCESS" |
| 65 | + }, |
| 66 | + "CLTCOOKIE": "iXus7", |
| 67 | + "STMTRS": { |
| 68 | + "CURDEF": "USD", |
| 69 | + "BANKACCTFROM": { |
| 70 | + "BANKID": "321081669", |
| 71 | + "ACCTID": "3576960405", |
| 72 | + "ACCTTYPE": "CHECKING" |
| 73 | + }, |
| 74 | + "BANKTRANLIST": { |
| 75 | + "DTSTART": "20010125120000.000", |
| 76 | + "DTEND": "20120126212302.638[-8:PST]", |
| 77 | + "STMTTRN": [{ |
| 78 | + "TRNTYPE": "DEP", |
| 79 | + "DTPOSTED": "20110407070000.000", |
| 80 | + "DTAVAIL": "20110407070000.000", |
| 81 | + "TRNAMT": "1934.65", |
| 82 | + "FITID": "156599402", |
| 83 | + "NAME": "CLIENT DEPOSIT", |
| 84 | + "MEMO": "CLIENT DEPOSIT" |
| 85 | + }, { |
| 86 | + "TRNTYPE": "DEBIT", |
| 87 | + "DTPOSTED": "20110412070000.000", |
| 88 | + "DTAVAIL": "20110412070000.000", |
| 89 | + "TRNAMT": "-700.00", |
| 90 | + "FITID": "156950780", |
| 91 | + "NAME": "DOMESTIC WIRE FUNDS-DEBIT CHRIST", |
| 92 | + "MEMO": "DOMESTIC WIRE FUNDS-DEBIT CHRISTIAN SULLIVAN" |
| 93 | + }, { |
| 94 | + "TRNTYPE": "CHECK", |
| 95 | + "DTPOSTED": "20110414070000.000", |
| 96 | + "DTAVAIL": "20110414070000.000", |
| 97 | + "TRNAMT": "-38.20", |
| 98 | + "FITID": "157222076", |
| 99 | + "CHECKNUM": "10004", |
| 100 | + "NAME": "CHECK WITHDRAWAL", |
| 101 | + "MEMO": "CHECK WITHDRAWAL" |
| 102 | + }, { |
| 103 | + "TRNTYPE": "CHECK", |
| 104 | + "DTPOSTED": "20110414070000.000", |
| 105 | + "DTAVAIL": "20110414070000.000", |
| 106 | + "TRNAMT": "-349.79", |
| 107 | + "FITID": "157222077", |
| 108 | + "CHECKNUM": "10006", |
| 109 | + "NAME": "CHECK WITHDRAWAL", |
| 110 | + "MEMO": "CHECK WITHDRAWAL" |
| 111 | + }] |
| 112 | + }, |
| 113 | + "LEDGERBAL": { |
| 114 | + "BALAMT": "1661.41", |
| 115 | + "DTASOF": "20120126212302.751[-8:PST]" |
| 116 | + }, |
| 117 | + "AVAILBAL": { |
| 118 | + "BALAMT": "2761.41", |
| 119 | + "DTASOF": "20120126212302.751[-8:PST]" |
| 120 | + } |
| 121 | + } |
| 122 | + } |
| 123 | + } |
| 124 | + } |
| 125 | +} |
| 126 | +``` |
| 127 | +
|
| 128 | +## TODO |
| 129 | + * Retrieve users available accounts with out account numbers |
| 130 | + * Add directory of common banks |
| 131 | +
|
| 132 | +## More Information |
| 133 | + * [Banking Connection Parameters](http://www.ofxhome.com/index.php/home/directory) |
| 134 | + * [Offical OFX Home Page](http://www.ofx.net/) |
| 135 | +
|
| 136 | +## License |
| 137 | +
|
| 138 | +(The MIT License) |
| 139 | +
|
| 140 | +Copyright (c) 2010-2012 Christian Sullivan <[email protected]> |
| 141 | +
|
| 142 | +Permission is hereby granted, free of charge, to any person obtaining |
| 143 | +a copy of this software and associated documentation files (the |
| 144 | +'Software'), to deal in the Software without restriction, including |
| 145 | +without limitation the rights to use, copy, modify, merge, publish, |
| 146 | +distribute, sublicense, and/or sell copies of the Software, and to |
| 147 | +permit persons to whom the Software is furnished to do so, subject to |
| 148 | +the following conditions: |
| 149 | +
|
| 150 | +The above copyright notice and this permission notice shall be |
| 151 | +included in all copies or substantial portions of the Software. |
| 152 | +
|
| 153 | +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
| 154 | +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 155 | +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. |
| 156 | +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 157 | +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 158 | +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 159 | +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
0 commit comments