studerw / td-ameritrade-client

TD Ameritrade Java Client
Apache License 2.0
69 stars 47 forks source link

New issue with retrieving transaction history #44

Closed karthik134 closed 3 years ago

karthik134 commented 3 years ago

For me, Transaction API history is failing with the below error.

try { transactions = client.fetchTransactions(accountId, request); } catch (Exception e) { e.printStackTrace();}

LoggingInterceptor.intercept INFO - REQUEST GET: https://api.tdameritrade.com/v1/accounts/accountId/transactions?startDate=2021-01-30&endDate=2021-05-10 LoggingInterceptor.intercept INFO - RESPONSE [200 - OK]: https://api.tdameritrade.com/v1/accounts/accountId/transactions?startDate=2021-01-30&endDate=2021-05-10 in 488.0 ms java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type com.studerw.tda.model.transaction.Transaction$AchStatus from String "Approved": not one of the values accepted for Enum class: [ERROR, CANCEL, REJECTED, APPROVED] at [Source: (BufferedInputStream); line: 6696, column: 17] (through reference chain: java.util.ArrayList[206]->com.studerw.tda.model.transaction.Transaction["achStatus"]) at com.studerw.tda.parse.DefaultMapper.fromJson(DefaultMapper.java:91)

studerw commented 3 years ago

@karthik134 What version are you using?

karthik134 commented 3 years ago

@studerw Version is 2.4.0. Also, I just noticed that it works for one account but does not work for another account.

By the way, thank you for putting together this API. This is a great library and gives a good headstart for implementing in Java.

studerw commented 3 years ago

@karthik134 I pushed a fix that I hope works. You will have to checkout the source yourself and build it, e.g. mvn clean install. This will install version 2.4.1-SNAPSHOT into your local maven / gradle repo. Then in your own project, change to this version ,e.g.

<dependency>
    <groupId>com.studerw.tda</groupId>
    <artifactId>td-ameritrade-client</artifactId>
    <version>2.4.1-SNAPSHOT</version>
  </dependency>

I will eventually release this as 2.4.1 if it works.

karthik134 commented 3 years ago

Thanks @studerw , I will checkout and test today and confirm. Appreciate the quick turnaround.

karthik134 commented 3 years ago

@studerw , sorry for the delay, I just tested the 2.4.1 release and it fixed the issue. Thanks again for the quick fix.