euforic / banking.js

The Missing API for Banks - Get all of your transactions and balances using node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: Cannot read property 'headers' of undefined

theBull opened this issue · comments

Hey, I'm getting the following error

TypeError: Cannot read property 'headers' of undefined
at Request.exports.getStatement as _callback
at Request.init.self.callback (/Users/dannybullis/Sites/cog_finance/node_modules/banking/node_modules/request/main.js:122:22)
at Request.EventEmitter.emit (events.js:96:17)
at Request.init (/Users/dannybullis/Sites/cog_finance/node_modules/banking/node_modules/request/main.js:170:10)
at new Request (/Users/dannybullis/Sites/cog_finance/node_modules/banking/node_modules/request/main.js:105:8)
at request (/Users/dannybullis/Sites/cog_finance/node_modules/banking/node_modules/request/main.js:995:11)
at Object.exports.getStatement (/Users/dannybullis/Sites/cog_finance/node_modules/banking/lib/banking.js:144:5)
at Object. (/Users/dannybullis/Sites/cog_finance/scripts/ofx_request.js:21:9)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)

Here's the script I'm trying to run:
var banking = require('banking');
var bankData = require('../secure/banking_data').bankData;
var userData = require('../secure/banking_data').userData;
var appData = require('../secure/banking_data').appData;

var bankInfo = {
fid: bankData.fid,
fidorg: bankData.org,
url: bankData.url,
bankid: bankData.bankid,
user: userData.id,
pass: userData.pass,
accid: userData.acct_number,
acctype: userData.acct_type,
date_start: 20130301,
date_end: 20130322,
};

banking.getStatement(bankInfo, function(res, err){
if(err) console.log(err)
console.log(res);
});

Doesn't appear to be something on my end, is there a bug somewhere? Thanks for the help! I'm stoked to use the module...once I get it working

Oops!!

I realized that I wasn't specifying the url protocol (https)...my url was:
www.oasis.cfree.com/1601.ofxgp

but once I added
https://www.oasis.cfree.com/1601.ofxgp

I got a response. Cool. Well, the response came back as an error. But that's for me to sort out. Onward ho!