Skip to content

Commit 70eb69e

Browse files
author
Gabriel Broadwin Nongsiej
committed
+ Fixing NumberFormatException for AIM card not present VOID transactions and for SIM transactions
+ Adding a field transactionId and an accessor method for this field for card not present transactions
1 parent 10b7be2 commit 70eb69e

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

.classpath

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<classpathentry kind="src" path="resources"/>
55
<classpathentry kind="src" path="src/test/java"/>
66
<classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>
7-
<classpathentry kind="lib" path="lib/httpclient-4.0.1.jar"/>
8-
<classpathentry kind="lib" path="lib/httpcore-4.0.1.jar"/>
7+
<classpathentry kind="lib" path="lib/httpclient-4.5.3.jar"/>
8+
<classpathentry kind="lib" path="lib/httpcore-4.4.6.jar"/>
99
<classpathentry kind="lib" path="lib/junit-4.8.2.jar"/>
1010
<classpathentry kind="lib" path="lib/log4j-1.2.16.jar"/>
1111
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>

src/main/java/net/authorize/aim/Result.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class Result<T> extends net.authorize.Result<T> {
1717
private ResponseCode responseCode;
1818
private ResponseReasonCode reasonResponseCode;
1919
private String responseText;
20+
private String transactionId;
2021

2122
private Result() { }
2223

@@ -29,8 +30,11 @@ public static <T> Result<T> createResult(T object, Map<ResponseField, String> re
2930
}
3031

3132
String responseCodeStr = responseMap.get(ResponseField.RESPONSE_CODE);
33+
34+
result.transactionId = responseMap.get(ResponseField.TRANSACTION_ID);
35+
3236
result.responseCode = responseCodeStr!=null && !"".equals(responseCodeStr)?
33-
ResponseCode.findByResponseCode(Integer.parseInt(responseCodeStr)):
37+
ResponseCode.findByResponseCode(Double.valueOf(responseCodeStr).intValue()):
3438
ResponseCode.ERROR;
3539

3640
String responseReasonCodeStr = responseMap.get(ResponseField.RESPONSE_REASON_CODE);
@@ -58,6 +62,10 @@ public String getResponseText() {
5862
return responseText;
5963
}
6064

65+
public String getTransactionId() {
66+
return transactionId;
67+
}
68+
6169
public boolean isApproved() {
6270
return ResponseCode.APPROVED.equals(this.responseCode);
6371
}

src/main/java/net/authorize/sim/Result.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static Result createResult(String apiLoginId, String merchantMD5Key, Map<
6969
}
7070

7171
result.responseCode = responseCodeStr!=null && !"".equals(responseCodeStr)?
72-
ResponseCode.findByResponseCode(Integer.parseInt(responseCodeStr)):
72+
ResponseCode.findByResponseCode(Double.valueOf(responseCodeStr).intValue()):
7373
ResponseCode.UNKNOWN;
7474
result.reasonResponseCode = responseReasonCodeStr!=null && !"".equals(responseReasonCodeStr)?
7575
ResponseReasonCode.findByReasonCode(Integer.parseInt(responseReasonCodeStr)):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy