Skip to content

Commit 711232e

Browse files
committed
Formatting fixes, updated version to 1.4.2
1 parent 7b7fbf2 commit 711232e

File tree

5 files changed

+21
-28
lines changed

5 files changed

+21
-28
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.ewaypayments</groupId>
77
<artifactId>eway-rapid-java</artifactId>
8-
<version>1.4.1</version>
8+
<version>1.4.2</version>
99
<packaging>jar</packaging>
1010

1111
<name>eWAY Rapid API Library</name>

src/main/java/com/eway/payment/rapid/sdk/message/convert/DirectPaymentToTransStatusConverter.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ public TransactionStatus doConvert(DirectPaymentResponse response) throws RapidS
1616
TransactionStatus status = new TransactionStatus();
1717
status.setBeagleScore(response.getBeagleScore() != null ? response.getBeagleScore() : 0.0);
1818
status.setCaptured(Boolean.parseBoolean(response.getTransactionCaptured()));
19-
20-
if (response.getFraudAction() == null || response.getFraudAction().equalsIgnoreCase("0") || response.getFraudAction() == "")
21-
{
22-
status.setFraudAction(FraudAction.valueOf(FraudAction.NotChallenged.name()));
23-
}
24-
else {
25-
status.setFraudAction(FraudAction.valueOf(response.getFraudAction()));
26-
}
19+
20+
if (response.getFraudAction() == null || response.getFraudAction().equalsIgnoreCase("0") || response.getFraudAction().isEmpty()) {
21+
status.setFraudAction(FraudAction.valueOf(FraudAction.NotChallenged.name()));
22+
} else {
23+
status.setFraudAction(FraudAction.valueOf(response.getFraudAction()));
24+
}
2725

2826
status.setProcessingDetails(getProcessingDetails(response));
2927

src/main/java/com/eway/payment/rapid/sdk/message/convert/InternalTransactionToStatusConverter.java

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,16 @@ public TransactionStatus doConvert(Transaction transaction) throws RapidSdkExcep
2525
transactionStatus.setCaptured(transaction.getTransactionCaptured());
2626

2727
transactionStatus.setProcessingDetails(getProcessingDetails(transaction));
28-
29-
try {
30-
if (transaction.getFraudAction() == null || transaction.getFraudAction().equalsIgnoreCase("0")|| transaction.getFraudAction() == "")
31-
{
32-
transactionStatus.setFraudAction(FraudAction.valueOf(FraudAction.NotChallenged.name()));
33-
}
34-
else{
3528

36-
transactionStatus.setFraudAction(FraudAction.valueOf(transaction.getFraudAction()));
37-
}
38-
39-
} catch (Exception e) {
40-
throw new ParameterInvalidException("Invalid Transaction Fraud Action: " + transaction.getFraudAction());
41-
}
29+
try {
30+
if (transaction.getFraudAction() == null || transaction.getFraudAction().equalsIgnoreCase("0") || transaction.getFraudAction().isEmpty()) {
31+
transactionStatus.setFraudAction(FraudAction.valueOf(FraudAction.NotChallenged.name()));
32+
} else {
33+
transactionStatus.setFraudAction(FraudAction.valueOf(transaction.getFraudAction()));
34+
}
35+
} catch (Exception e) {
36+
throw new ParameterInvalidException("Invalid Transaction Fraud Action: " + transaction.getFraudAction());
37+
}
4238

4339
if (!StringUtils.isBlank(transaction.getTransactionID())) {
4440
try {
@@ -73,13 +69,13 @@ private ProcessingDetails getProcessingDetails(Transaction response) {
7369

7470
private BeagleVerifyStatus getBeagleVerification(String code) {
7571
if ("0".equalsIgnoreCase(code)) {
76-
return BeagleVerifyStatus.NotVerified;
72+
return BeagleVerifyStatus.NotVerified;
7773
} else if ("1".equalsIgnoreCase(code)) {
78-
return BeagleVerifyStatus.Attempted;
74+
return BeagleVerifyStatus.Attempted;
7975
} else if ("2".equalsIgnoreCase(code)) {
80-
return BeagleVerifyStatus.Verified;
76+
return BeagleVerifyStatus.Verified;
8177
} else if ("3".equalsIgnoreCase(code)) {
82-
return BeagleVerifyStatus.Failed;
78+
return BeagleVerifyStatus.Failed;
8379
}
8480
return null;
8581
}

src/main/java/com/eway/payment/rapid/sdk/message/convert/response/CancelAuthorisationToRefundConverter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public RefundResponse doConvert(CancelAuthorisationResponse cancel) throws Rapid
2525
TransactionStatus status = new TransactionStatus();
2626
status.setStatus(cancel.getTransactionStatus());
2727
ProcessingDetails detail = new ProcessingDetails();
28-
detail.setResponseCode(cancel.getErrors());
2928
detail.setResponseCode(cancel.getResponseCode());
3029
status.setProcessingDetails(detail);
3130
status.setTransactionID(Integer.parseInt(cancel.getTransactionID()));
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
global.rapid.rest.production.url = https://api.ewaypayments.com
22
global.rapid.rest.sandbox.url = https://api.sandbox.ewaypayments.com
3-
rapid.sdk.user.agent = eWAY SDK Java 1.4.1
3+
rapid.sdk.user.agent = eWAY SDK Java 1.4.2

0 commit comments

Comments
 (0)