Skip to content

Commit 5d11373

Browse files
authored
Merge pull request #52 from EduardoSorokin/fix-transaction-status
fix: fixing ENUM values (ID) of transaction status
2 parents 5465ec7 + 1d841c7 commit 5d11373

File tree

4 files changed

+414
-407
lines changed

4 files changed

+414
-407
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
4.3.2
2+
- Corrigidos os IDs de status da transação
3+
4+
4.3.1
5+
- Adicionado o parâmetro sender hash nos exemplos de checkout
6+
- Corrigido o valor padrão do estado no endereço dos exemplos
7+
18
4.3.0
29
- Solicitar autorização com envio opcional dos dados do cliente para sugestão de cadastro
310

source/src/main/java/br/com/uol/pagseguro/api/common/domain/TransactionStatus.java

Lines changed: 106 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -27,127 +27,127 @@
2727
*/
2828
public class TransactionStatus {
2929

30-
private final Integer statusId;
31-
32-
/**
33-
* Constructor
34-
*
35-
* @param statusId Status id
36-
*/
37-
public TransactionStatus(Integer statusId) {
38-
this.statusId = statusId;
39-
}
40-
41-
/**
42-
* Get status id
43-
*
44-
* @return Status id
45-
*/
46-
public int getStatusId() {
47-
return statusId;
48-
}
49-
50-
/**
51-
* Get status by status id
52-
*
53-
* @return Status
54-
* @see Status
55-
*/
56-
public Status getStatus() {
57-
return Status.fromStatusId(statusId);
58-
}
59-
60-
/**
61-
* Status enum
62-
*/
63-
public enum Status {
30+
private final Integer statusId;
6431

6532
/**
66-
* INITIAL
67-
*/
68-
INITIAL(1),
69-
70-
/**
71-
* WAITING PAYMENT
72-
*/
73-
WAITING_PAYMENT(2),
74-
75-
/**
76-
* IN REVIEW
77-
*/
78-
IN_REVIEW(3),
79-
80-
/**
81-
* APPROVED
82-
*/
83-
APPROVED(4),
84-
85-
/**
86-
* AVAILABLE
87-
*/
88-
AVAILABLE(5),
89-
90-
/**
91-
* IN DISPUTE
92-
*/
93-
IN_DISPUTE(6),
94-
95-
/**
96-
* RETURNED
97-
*/
98-
RETURNED(7),
99-
100-
/**
101-
* CANCELLED
102-
*/
103-
CANCELLED(8),
104-
105-
/**
106-
* SELLER CHARGEBACK
107-
*/
108-
SELLER_CHARGEBACK(9),
109-
110-
/**
111-
* CONTESTATION
112-
*/
113-
CONTESTATION(10),
114-
115-
/**
116-
* PROCESSING REFUND
117-
*/
118-
PROCESSING_REFUND(11),
119-
120-
/**
121-
* UNRECOGNIZED
33+
* Constructor
34+
*
35+
* @param statusId Status id
12236
*/
123-
UNRECOGNIZED(null);
124-
125-
private Integer statusId;
37+
public TransactionStatus(Integer statusId) {
38+
this.statusId = statusId;
39+
}
12640

12741
/**
128-
* Constructor
42+
* Get status id
12943
*
130-
* @param statusId Status id
44+
* @return Status id
13145
*/
132-
Status(Integer statusId) {
133-
this.statusId = statusId;
46+
public int getStatusId() {
47+
return statusId;
13448
}
13549

13650
/**
13751
* Get status by status id
13852
*
139-
* @param statusId Status id
14053
* @return Status
54+
* @see Status
14155
*/
142-
public static Status fromStatusId(Integer statusId) {
143-
for (Status status : Status.values()) {
144-
if (status.statusId != null && status.statusId == statusId) {
145-
return status;
146-
}
147-
}
148-
return UNRECOGNIZED;
56+
public Status getStatus() {
57+
return Status.fromStatusId(statusId);
14958
}
15059

151-
}
60+
/**
61+
* Status enum
62+
*/
63+
public enum Status {
64+
65+
/**
66+
* INITIAL
67+
*/
68+
INITIAL(0),
69+
70+
/**
71+
* WAITING PAYMENT
72+
*/
73+
WAITING_PAYMENT(1),
74+
75+
/**
76+
* IN REVIEW
77+
*/
78+
IN_REVIEW(2),
79+
80+
/**
81+
* APPROVED
82+
*/
83+
APPROVED(3),
84+
85+
/**
86+
* AVAILABLE
87+
*/
88+
AVAILABLE(4),
89+
90+
/**
91+
* IN DISPUTE
92+
*/
93+
IN_DISPUTE(5),
94+
95+
/**
96+
* RETURNED
97+
*/
98+
RETURNED(6),
99+
100+
/**
101+
* CANCELLED
102+
*/
103+
CANCELLED(7),
104+
105+
/**
106+
* SELLER CHARGEBACK
107+
*/
108+
SELLER_CHARGEBACK(8),
109+
110+
/**
111+
* CONTESTATION
112+
*/
113+
CONTESTATION(9),
114+
115+
/**
116+
* PROCESSING REFUND
117+
*/
118+
PROCESSING_REFUND(11),
119+
120+
/**
121+
* UNRECOGNIZED
122+
*/
123+
UNRECOGNIZED(null);
124+
125+
private Integer statusId;
126+
127+
/**
128+
* Constructor
129+
*
130+
* @param statusId Status id
131+
*/
132+
Status(Integer statusId) {
133+
this.statusId = statusId;
134+
}
135+
136+
/**
137+
* Get status by status id
138+
*
139+
* @param statusId Status id
140+
* @return Status
141+
*/
142+
public static Status fromStatusId(Integer statusId) {
143+
for (Status status : Status.values()) {
144+
if (status.statusId != null && status.statusId == statusId) {
145+
return status;
146+
}
147+
}
148+
return UNRECOGNIZED;
149+
}
150+
151+
}
152152

153153
}

0 commit comments

Comments
 (0)