Skip to content

Commit

Permalink
Bug Fix in getLoan data with different types of error reason (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dijkztra committed Mar 1, 2019
1 parent e1bb230 commit 4927358
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.xfers</groupId>
<artifactId>xfers-java</artifactId>
<version>1.14.0</version>
<version>1.15.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.xfers</groupId>
<artifactId>xfers-java</artifactId>
<packaging>jar</packaging>
<version>1.14.0</version>
<version>1.15.0</version>
<name>xfers-java</name>
<description>Xfers Java Bindings</description>
<url>https://github.com/Xfers/xfers-java</url>
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/com/xfers/model/channeling/loan/Loan.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import com.xfers.serializer.SnakeToCamelDeserializer;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -26,10 +24,10 @@ public class Loan {
private static final String loanURL = "/loans";
private String id;
private String status;
private Map<String, Object> lastRacErrorReason;
private Map<String, Object> lastSlikErrorReason;
private Map<String, Object> lastWithdrawalOnBehalfErrorReason;
private Map<String, Object> lastDisbursementReportErrorReason;
private Object lastRacErrorReason;
private Object lastSlikErrorReason;
private Object lastWithdrawalOnBehalfErrorReason;
private Object lastDisbursementReportErrorReason;
@SerializedName("collateral_data") private Collateral collateral;
@SerializedName("company_management_data") private CompanyManagement companyManagement;
@SerializedName("customer_data") private Customer customer;
Expand Down Expand Up @@ -73,7 +71,7 @@ public Loan installment(Installment installment) {
}

public static Loan fromJSON(String json) {
return new Gson().fromJson(json, Loan.class);
return SnakeToCamelDeserializer.create().fromJson(json, Loan.class);
}

public static Loan getLoan(String id, String userApiToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void main(String[] args) {
String xfersAppApiKey = "";
String xfersAppSecretKey = "";
String phoneNumber = "";

// Step 1, need to verify user first to comply with regulation.
// After that you can chose to add the user's bank account tag to the user as show case
// in this example.
Expand Down

0 comments on commit 4927358

Please sign in to comment.