Giter VIP home page Giter VIP logo

ofx4j's People

Contributors

arambau avatar ashgupta1489 avatar axiopisty avatar betterzega avatar dependabot[bot] avatar dhilst avatar ekennedy247 avatar fleminra avatar ghe2014 avatar icecreamhead avatar joserobjr avatar kramerc avatar maor11 avatar matchami avatar rshkwee avatar simeonmalchev avatar stoicflame avatar timothystone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ofx4j's Issues

Error opening zip file

Hi, I'm having this problem " error in opening zip file". I put the dependencies like you told, because of this I got this error. Can you help me?

Charset problems

Hello,

I started using your parser in a project. The project parsers many file types from distinct SO. So I detected charset problem.

Your parser does not change the reader charset based on the headers or tags identifying the OFX/OFC itself.

BoA does not support your software version

I am using version 1.27 and whenever I try to fi.readProfile or fi.loadBankAccount I get the following response "Invalid signon: Online Banking with Bank of America does not support your software version. Please check that you have current version."

I have triple checked everything in FinancialInstitutionData. I called Bank of America to ask them if I needed to enable any Direct Connect services and they said no. Is there anything else I can try?

Thank you

OSGi bundle doesn't export client.impl

META-INF/MANIFEST.MF does not export com.webcohesion.ofx4j.client.impl, and I am not sure I see another way to access LocalResourceFIDataStore. If I try to use it, my own bundle would declare a dependency on it, which ofx4j's bundle wouldn't export.

I am using the latest master.

Learning - could use some guidance

I'm building a simple JavaFX app to pull down financial transactions from my bank and would like to use OFX4J. My background is C++ in embedded systems, but I'm venturing into Java with this.

Could you please provide some advice on the simplest approach to including the OFX4J code in my app? E.g. build one or more JAR files? Or possibly include as java files in the project folder?

Appreciate any guidance and direction. -Jay

Getting an exception when calling readStatement and readProfile

Following the instructions on the README and seeing this error when calling readStatement or readProfile.

Required element 'LANGUAGE' (property 'language' of aggregate
com.webcohesion.ofx4j.domain.data.signon.SignonRequest) is null or empty

The prior steps all appear to work.

Add support for 401(K) loans

Section 13.9.3 "401(k) Account Information" is not implemented at all.
I can create a pull request to add partial support for it (read the simple elements and the loan info aggregates).

Currency should be a @ChildAggregate not an @Element in IncomeTransaction

Hi,
I think that Currency should be a @_ChildAggregate not an @_Element in IncomeTransaction. Currentrly, in IncomeTransaction there is this method:

  /**
   * Gets the currency code for the transaction. Only one of currency code or original currency
   * info should be set according to the OFX spec. If neither are set, means the default currency.
   * @see "Section 13.9.2.4.3, OFX Spec"
   *
   * @return the currency code for the transaction
   */
  @Element( name = "CURRENCY", order = 90)
  public String getCurrencyCode() {
    return currencyCode;
  }

I think the relevant OFX section is off by one, it seems to be "Section 13.9.2.4.4, OFX Spec", the one that concerns Currency in Income. And this section says:

<INCOME>
<INVTRAN> aggregate
<SECID> aggregate
<INCOMETYPE>
<TOTAL>
<SUBACCTSEC>
<SUBACCTFUND>
<TAXEXEMPT>
<WITHHOLDING>
<CURRENCY> aggregate
<ORIGCURRENCY> aggregate

Investment income is realized as cash into the investment account.
A negative TOTAL is used to denote adjustments to income.

The DTD of the spec also shows that CURRENCY and/or ORIGCURRENCY aggregates are allowed inside INCOME.
I found the OFX spec ^^ for v1.0.2 here: https://ofxorg.ocg-prod.a.intuit.com/downloads.html

Ampersand in OFX v1 file not supported

An OFX v1 file downloaded from CIBC contained a line similar to the following

<MEMO>DEBIT MEMO 05987 EFT CREDIT PAYMENT REVERSAL ABM CHANNEL & CARD MANAGEMT SE

resulting in the following stacktrace:

Exception in thread "main" java.lang.IllegalStateException: java.io.IOException: Unexpected EOF
	at com.webcohesion.ofx4j.io.AggregateUnmarshaller.unmarshal(AggregateUnmarshaller.java:70)
	at com.plantango.ofx.App.main(App.java:38)
Caused by: java.io.IOException: Unexpected EOF
	at net.n3.nanoxml.StdXMLReader.read(Unknown Source)
	at net.n3.nanoxml.XMLUtil.read(Unknown Source)
	at net.n3.nanoxml.ContentReader.read(Unknown Source)
	at net.n3.nanoxml.ContentReaderBackdoor.read(ContentReaderBackdoor.java:24)
	at java.base/java.io.Reader.read(Reader.java:229)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.readCharacters(NanoXMLOFXReader.java:200)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:173)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:150)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:150)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:150)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:150)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:150)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:150)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.parseV1FromFirstElement(NanoXMLOFXReader.java:52)
	at com.webcohesion.ofx4j.io.BaseOFXReader.parse(BaseOFXReader.java:113)
	at com.webcohesion.ofx4j.io.AggregateUnmarshaller.unmarshal(AggregateUnmarshaller.java:63)
	... 1 more

Note the unescaped & in the memo. I tried parsing and converting with the Python library ofxtools which worked without issues. The OFX v1 spec itself doesn't seem to require escaping special symbols like & AFAIK.

Escaping ampersand by replacing the & with &amp; fixed the issue for me. I don't know if we wan't to fix this in the library (or just recommend preprocessing the file) but a better error message would definitively be helpful

Unmarshalling file with & symbol in the name.

WHEN

ResponseEnvelope envelope = unmarshaller.unmarshal(file);

Parsing ofx file with the following statement transaction:

        	<STMTTRN>
                		<TRNTYPE>DEBIT
                		</TRNTYPE>
                		<DTPOSTED>20161110000044</DTPOSTED>
                		<DTUSER></DTUSER>
                		<TRNAMT>-01.01</TRNAMT>
                		<FITID>17</FITID>
                		<NAME>EE & T-MOBILE            </NAME>
                		<MEMO></MEMO>
                	</STMTTRN>

THEN

Caused by: java.io.IOException: Unexpected EOF
	at net.n3.nanoxml.StdXMLReader.read(Unknown Source)
	at net.n3.nanoxml.XMLUtil.read(Unknown Source)
	at net.n3.nanoxml.ContentReader.read(Unknown Source)
	at net.n3.nanoxml.ContentReaderBackdoor.read(ContentReaderBackdoor.java:24)
	at java.io.Reader.read(Reader.java:140)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.readCharacters(NanoXMLOFXReader.java:186)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:159)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:136)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:136)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:136)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:136)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:136)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.processOFXTag(NanoXMLOFXReader.java:136)
	at com.webcohesion.ofx4j.io.nanoxml.NanoXMLOFXReader.parseV1FromFirstElement(NanoXMLOFXReader.java:45)
	at com.webcohesion.ofx4j.io.BaseOFXReader.parse(BaseOFXReader.java:113)
	at com.webcohesion.ofx4j.io.BaseOFXReader.parse(BaseOFXReader.java:68)
	at com.webcohesion.ofx4j.io.AggregateUnmarshaller.unmarshal(AggregateUnmarshaller.java:44)

Encoding problem

Hello, when the ofx files has special characters like ã, é, í, (...) the character is replaced by a �...

So, how do I change the encoding type?

java.time support?

Is there any plan/desire to add native support for the modern java.time datetime API rather than the deprecated java.util.Date API which it currently uses? One benefit would be the ability to support zone offset information in datetime fields.

Problem reading ofx file

I'm new to ofx4j. I'm trying to follow the logic in TestNanoXMLOFXReader.java to parse ofx files. But when there are more than one STMTTRN aggregate in the file, the DefaultHandler in TestNanoXMLOFXReader drops all STMTTRN except the very last one. It seems that it is because of the usage of TreeMap structure to keep track of the aggregate information. I think using a List instead of TreeMap to keep track the aggregate information would fix the problem. Or maybe there is some other way to parse ofx files?

OFXHEADER value not trimmed

I am dealing with a bank who sends the following header:

OFXHEADER: 100
DATA: OFXSGML
VERSION: 102
SECURITY: NONE
ENCODING: USASCII
CHARSET: 1252
COMPRESSION: NONE
OLDFILEUID: NONE
NEWFILEUID: NONE

Note that there is a space after the colon before the value. This is causing the following parse error:

java.lang.IllegalArgumentException: No enum constant net.sf.ofx4j.domain.data.ApplicationSecurity. NONE
at java.lang.Enum.valueOf(Enum.java:238)
at net.sf.ofx4j.io.DefaultStringConversion.fromString(DefaultStringConversion.java:81)
at net.sf.ofx4j.io.AggregateStackContentHandler.onHeader(AggregateStackContentHandler.java:50)
at net.sf.ofx4j.io.BaseOFXReader.processOFXv1Headers(BaseOFXReader.java:193)
at net.sf.ofx4j.io.BaseOFXReader.parse(BaseOFXReader.java:111)
at net.sf.ofx4j.io.BaseOFXReader.parse(BaseOFXReader.java:68)
at net.sf.ofx4j.io.AggregateUnmarshaller.unmarshal(AggregateUnmarshaller.java:44)

If I remove the space, it all parses fine. I looked at processOFXv1Headers and it does NOT trim the value. However, I also see that processOFXv2Headers DOES trim the header.

I looked at spec and it was unclear to me if v1 does NOT allow a space and v2 does?

So is this an issue the bank needs to fix or should OFX4J trim the v1 value also? Should this question be asked elsewhere?

Tomcat 7 doesn't run with ofx4j

Hello, I just added ofx4j in the pom.xml of my web project, and after that my Tomcat doesn't start anymore, and this error is showed on console:

GRAVE: The web application [/MegaSindico] created a ThreadLocal with key of type [org.jvnet.hk2.internal.PerLocatorUtilities$2] (value [org.jvnet.hk2.internal.PerLocatorUtilities$2@5bcab519]) and a value of type [java.util.WeakHashMap] (value [{private org.jvnet.hk2.internal.DynamicConfigurationServiceImpl(org.glassfish.hk2.api.ServiceLocator)=org.jvnet.hk2.internal.SoftAnnotatedElementAnnotationInfo@e45f292}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

If i remove the library from pom.xml my project run normally...

how to create *.ofx files importable by, e.g. GnuCash

When downloading statements from a FI, I'd like to be able to create *.ofx files importable by GnuCash, compatible with the OFX files that banks' interactive websites offer.

I find that when I call FinancialInstitutionAccount.readStatement() and marshal that out to a file, that file is not usable by GnuCash. (Didn't test with Quicken or anything else.) Such files have <CCSTMTRS/> as the root element.

It turns out that if I marshal out the whole, ResponseEnvelope, that works with GnuCash. Such files have <OFX/> as the root element.

However I can't seem to find an clever way to gain access to the ResponseEnvelope that's currently just a local variable in BaseAccountImpl.readStatement().

The only way I've found, is to change interface FinancialInstitutionAccount, adding a new method readStatementResponseEnvelope(). In BaseAccountImpl, readStatementResponseEnvelope() is a clone of readStatement(), but which returns the ResponseEnvelope instead of the statement.

It doesn't seem possible for my project to subclass BaseAccountImpl to provide readStatementResponseEnvelope(), because I don't see a way of injecting my custom BaseAccountImpl into the stack.

I don't know if it's worth finding general way for the caller to access ResponseEnvelopes or this is the only practical use case for having access to them. If the latter, then the first approach that comes to mind would be to just factor readStatement() into (public) separate readStatementResponseEnvelope() and readStatement(), with the latter invoking the former. Doesn't seem elegant though.

Thoughts?

Unable to Compile with ofx4j on Java 17

When trying to compile with the ofx4j library (version 1.35) I get the following error

error reading /Users/{myuser}/.gradle/caches/modules-2/files-2.1/com.webcohesion.ofx4j/ofx4j/1.35/d3d08d31b36d698f3f2f02174274359c618efd62/ofx4j-1.35.jar; Invalid CEN header (invalid zip64 extra data field size)

This seems like the exact same issue filed on ApkTool
From that thread it seems like the issue is caused by JDK 17.0.8.

The following is mentioned in the JDK changelog:

Improved ZIP64 Extra Field Validation (JDK-8302483 (not public))

java.util.zip.ZipFile has been updated to provide additional validation of ZIP64 extra fields when opening a ZIP file. This validation may be disabled by setting the system property jdk.util.zip.disableZip64ExtraFieldValidation to true.

I am trying to disable that validation locally (I haven't figure out the correct Gradle config for that yet), but it seems like the root of the issue is that the ofx4j jar itself is failing a ZIP file validation.

Support Profile URL for institutions like Vanguard

Hi,
Vanguard has changed their OFX service so now you're required to call readProfile() before trying to fetch account data and then you have to use the cookies for the subsequent calls. readProfile should call a different URL than the rest of the requests.

I would suggest to add a profileUrl member to BaseFinancialInstitutionData and use that in readProfile().

Also, another change is required to keep the connection open between requests (and then close it when done).

BALAMT NumberFormatException

When <BALAMT> TAG of LEDGERBAL contains comma throws a NumberFormatException, other values like TRNAMT do not
Error:
11:40:27,126 ERROR [com.webcohesion.ofx4j.io.AggregateStackContentHandler] (default task-1) Unable to set element 'BALAMT' (property 'amount' of aggregate com.webcohesion.ofx4j.domain.data.common.BalanceInfo): java.lang.NumberFormatException: For input string: "-366622,72"

OFXServerException when connecting to Citi Credit Card

Has anyone successfully connected to Citi Credit Card? I received a OFXServerException running ofx4j 1.28:

com.webcohesion.ofx4j.client.net.OFXServerException: Error with client request: Forbidden
at com.webcohesion.ofx4j.client.net.OFXV1Connection.sendBuffer(OFXV1Connection.java:106)
at com.webcohesion.ofx4j.client.net.OFXV1Connection.sendRequest(OFXV1Connection.java:59)
at com.webcohesion.ofx4j.client.impl.FinancialInstitutionImpl.sendRequest(FinancialInstitutionImpl.java:151)
at com.webcohesion.ofx4j.client.impl.FinancialInstitutionImpl.readAccountProfiles(FinancialInstitutionImpl.java:92)

how to set a custom clientUID?

OFX4J novice here. Great library, thank you!

Is there a better way to set a custom client UID, than by extending FinancialInstitutionImpl and overriding createSignonRequest() (in Scala, sorry):

class CustomClientUIDFinancialInstitutionImpl(data: FinancialInstitutionData, connection: OFXConnection, clientUID: String)
  extends FinancialInstitutionImpl(data, connection) {

  override def createSignonRequest(username: String, password: String): SignonRequest = {
    val signonRequest= new SignonRequest
    signonRequest.setTimestamp(new Date)
    val fi = new FinancialInstitution
    fi.setId(getData.getFinancialInstitutionId)
    fi.setOrganization(getData.getOrganization)

    signonRequest.setClientUID(clientUID) // <<-----

    signonRequest.setFinancialInstitution(fi)
    signonRequest.setUserId(username)
    signonRequest.setPassword(password)
    signonRequest.setApplicationId(OFXApplicationContextHolder.getCurrentContext.getAppId)
    signonRequest.setApplicationVersion(OFXApplicationContextHolder.getCurrentContext.getAppVersion)

    signonRequest
  }
}

And then:

class CustomClientUIDFinancialInstitutionService extends FinancialInstitutionServiceImpl {
  def getFinancialInstitution(data: FinancialInstitutionData, clientUID: String): FinancialInstitution =
    if (data == null)
      null
    else
      new CustomClientUIDFinancialInstitutionImpl(data, getConnection(), clientUID)
}

Usage:

val fi = (new CustomClientUIDFinancialInstitutionService).getFinancialInstitution(data, clientUID)

Seems like there ought to be a way to do it that doesn't duplicate everything in createSignonRequest().

(FWIW, Chase (credit cards) requires a custom client UID. They use it as a form of multi-factor authentication.)

New tags are not available in the library

I'm trying to use this library to interface with Turbo Tax. But Turbo Tax XML mapping has some tags which are not available in this library (Such as COLLECTIBLE tag for tax 1099). Will they be added later?

question: do you want updates to institutions.xml?

I see that institutions.xml is 12 years old. Are you interested in pulling updates? I realize it's pretty volatile data and it's probably hopeless to keep it up-to-date. I wonder what most people are doing — keeping their own local changes to it? Or just storing the FI particulars outside of that file.

OFX / Vanguard Issues

Last week OFX responses from Vanguard started coming back empty. The response code is OK, but the response body is empty on the return InputStream OFXV1Connection.sendBuffer(URL, ByteArrayOutputStream).

If I send the same body via the standalone Postman app I get the correct OFX response body.

The Postman chrome app; ofx4j; command-line CURL and a couple other Java HTTP Client libraries all return response code 200 but an empty body.

Any ideas why this could be occurring or what else I could try to resolve this issue?

OSGi bundle exports a conflicting package

net.n3.nanoxml is already exported by nanoxml bundle. Overlapping packages like this doesn't work in OSGi. I understand the motivation behind this workaround, but it prevents OSGi users from using the library (amongst other things).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.