nordbergm / stripe2ofx

A small command line utility that converts the Stripe transfer exports (CSV) to the OFX file format often used by accounting software for bank statement imports.
2 stars 2 forks source link

app crashes on currency parsing #3

Closed binary1230 closed 9 years ago

binary1230 commented 9 years ago

Hey I intend on fixing this, I need this app to work to make my life not suck :)

When I run this on a transfers.csv from 11/12/2014, it throws this error:

vagrant@localhost:~/stripe/stripe2ofx$ nodejs stripe2ofx.js
Transactions:   58

/home/vagrant/stripe/stripe2ofx/stripe2ofx.js:31
    throw 'Could not determine currency of transactions';
    ^
Could not determine currency of transactions

I believe maybe the file format has changed since this utility was written, each column in the CSV now contains currency information like so:

image

It seems like the code that attempts to find the currency is looking for a dollar sign or other marker in the 'Amount' column, but this no longer exists:

  for (var i = 0; i < currencies.length; i++) {
    var cur = currencies[i];
    if (getCell(data, data[1], 'Amount').indexOf(cur.sign) == 0) {
      currency = cur;
      break;
    }
  }

Instead that code should probably be reading the 'currency' column and doing per-row currency, or something.

binary1230 commented 9 years ago

I'll take a shot at fixing this and submit a pull request if successful. I don't have any experience with OFX files so will need to read up on the spec to make sure what I'm doing is right with the currency stuff.

binary1230 commented 9 years ago

yea turns out the entire export out of stripe is totally different now. I've fixed the currency issue I think, working on some other stuff related to Fees and such that has changed.

binary1230 commented 9 years ago

partially fixed in wip_updates branch, however, there are more changes to fix with Stripe updating their fees, refunds, and adjustments code.