Skip to content

Commit 6dee878

Browse files
committed
Add error codes for soft declines
1 parent 9276f6a commit 6dee878

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ This library provide ability to make requests to Transact Pro Gateway API v3.
1212
<dependency>
1313
<groupId>com.github.transactpro</groupId>
1414
<artifactId>gateway</artifactId>
15-
<version>1.3.2</version>
15+
<version>1.3.3</version>
1616
</dependency>
1717
```
1818

1919
#### Gradle
2020

2121
```groovy
22-
implementation 'com.github.transactpro:gateway:1.3.2'
22+
implementation 'com.github.transactpro:gateway:1.3.3'
2323
```
2424

2525
## Documentation
@@ -66,6 +66,7 @@ Available operations:
6666
```java
6767

6868
import com.github.transactpro.gateway.Gateway;
69+
import com.github.transactpro.gateway.model.request.data.PaymentMethod;
6970
import com.github.transactpro.gateway.operation.transaction.Sms;
7071
import com.github.transactpro.gateway.model.exception.ResponseException;
7172
import com.github.transactpro.gateway.model.digest.exception.DigestMismatchException;
@@ -141,7 +142,7 @@ public class Main {
141142
PaymentResponse parsedSmsResponse = sms.getResponse().parse();
142143
if (parsedSmsResponse.getError() != null && parsedSmsResponse.getError().getCode() != 0) {
143144
// Process Gateway error
144-
} else if (parsedSmsResponse.getGw().getStatusCode() == Status.MPI_URL_GENERATED) {
145+
} else if (parsedSmsResponse.getGw().getRedirectUrl() != null) {
145146
// Redirect user to received URL
146147
}
147148
} catch (IOException e) {
@@ -156,9 +157,9 @@ public class Main {
156157
// Do something with unexpected error
157158
} finally {
158159
// Results
159-
System.out.println(sms.getResponse().getBody());
160-
System.out.println(sms.getResponse().getStatusCode());
161-
System.out.println(sms.getResponse().getHeaders());
160+
java.lang.System.out.println(sms.getResponse().getBody());
161+
java.lang.System.out.println(sms.getResponse().getStatusCode());
162+
java.lang.System.out.println(sms.getResponse().getHeaders());
162163
}
163164
}
164165
}

pom.xml

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

77
<groupId>com.github.transactpro</groupId>
88
<artifactId>gateway</artifactId>
9-
<version>1.3.2</version>
9+
<version>1.3.3</version>
1010

1111
<name>Transact Pro Gateway v3 Java client library</name>
1212
<description>A library that provide ability to make requests to Transact Pro Gateway API v3.</description>

src/main/java/com/github/transactpro/gateway/model/response/constants/ErrorCode.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public enum ErrorCode {
8080
EEC_DYNAMIC_DESCRIPTOR_ERROR(1158),
8181
@SerializedName("1159")
8282
EEC_UCOF_ERROR(1159),
83+
@SerializedName("1160")
84+
EEC_SUSPECTED_FRAUD(1160),
8385
@SerializedName("1200")
8486
EEC_TERMINAL_NOT_FOUND(1200),
8587
@SerializedName("1201")
@@ -96,6 +98,8 @@ public enum ErrorCode {
9698
EEC_DECLINED_BY_ACQUIRER(1301),
9799
@SerializedName("1302")
98100
EEC_ACQUIRER_ERROR(1302),
101+
@SerializedName("1303")
102+
EEC_ACQUIRER_SOFT_DECLINE(1303),
99103
@SerializedName("1400")
100104
EEC_INVALID_FORM_ID(1400),
101105
@SerializedName("1401")

0 commit comments

Comments
 (0)