Skip to content

Commit 3c3f5f4

Browse files
authored
Merge pull request #79 from AuthorizeNet/ashtru-patch-1
Corrected formatting
2 parents 0b55add + b0170d6 commit 3c3f5f4

File tree

1 file changed

+35
-38
lines changed

1 file changed

+35
-38
lines changed

src/main/java/net/authorize/sample/TransactionReporting/GetUnsettledTransactionList.java

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,45 @@
99

1010
//author @krgupta
1111
public class GetUnsettledTransactionList{
12-
13-
public static ANetApiResponse run(String apiLoginId, String transactionKey) {
14-
ApiOperationBase.setEnvironment(Environment.SANDBOX);
12+
public static ANetApiResponse run(String apiLoginId, String transactionKey) {
13+
ApiOperationBase.setEnvironment(Environment.SANDBOX);
1514

16-
MerchantAuthenticationType merchantAuthenticationType = new MerchantAuthenticationType() ;
17-
merchantAuthenticationType.setName(apiLoginId);
18-
merchantAuthenticationType.setTransactionKey(transactionKey);
19-
ApiOperationBase.setMerchantAuthentication(merchantAuthenticationType);
15+
MerchantAuthenticationType merchantAuthenticationType = new MerchantAuthenticationType() ;
16+
merchantAuthenticationType.setName(apiLoginId);
17+
merchantAuthenticationType.setTransactionKey(transactionKey);
18+
ApiOperationBase.setMerchantAuthentication(merchantAuthenticationType);
2019

21-
GetUnsettledTransactionListRequest getRequest = new GetUnsettledTransactionListRequest();
22-
getRequest.setMerchantAuthentication(merchantAuthenticationType);
23-
getRequest.setStatus(TransactionGroupStatusEnum.ANY);
20+
GetUnsettledTransactionListRequest getRequest = new GetUnsettledTransactionListRequest();
21+
getRequest.setMerchantAuthentication(merchantAuthenticationType);
22+
getRequest.setStatus(TransactionGroupStatusEnum.ANY);
2423

25-
Paging paging = new Paging();
26-
paging.setLimit(100);
27-
paging.setOffset(1);
24+
Paging paging = new Paging();
25+
paging.setLimit(100);
26+
paging.setOffset(1);
2827

29-
getRequest.setPaging(paging);
28+
getRequest.setPaging(paging);
3029

31-
TransactionListSorting sorting = new TransactionListSorting();
32-
sorting.setOrderBy(TransactionListOrderFieldEnum.ID);
33-
sorting.setOrderDescending(true);
30+
TransactionListSorting sorting = new TransactionListSorting();
31+
sorting.setOrderBy(TransactionListOrderFieldEnum.ID);
32+
sorting.setOrderDescending(true);
3433

35-
getRequest.setSorting(sorting);
36-
37-
GetUnsettledTransactionListController controller = new GetUnsettledTransactionListController(getRequest);
38-
controller.execute();
39-
GetUnsettledTransactionListResponse getResponse = controller.getApiResponse();
40-
41-
if (getResponse!=null) {
42-
43-
if (getResponse.getMessages().getResultCode() == MessageTypeEnum.OK) {
44-
45-
System.out.println(getResponse.getMessages().getMessage().get(0).getCode());
46-
System.out.println(getResponse.getMessages().getMessage().get(0).getText());
47-
}
48-
else
49-
{
50-
System.out.println("Failed to get unsettled transaction list: " + getResponse.getMessages().getResultCode());
51-
}
52-
}
53-
return getResponse;
54-
55-
}
34+
getRequest.setSorting(sorting);
35+
36+
GetUnsettledTransactionListController controller = new GetUnsettledTransactionListController(getRequest);
37+
controller.execute();
38+
GetUnsettledTransactionListResponse getResponse = controller.getApiResponse();
39+
40+
if (getResponse!=null) {
41+
if (getResponse.getMessages().getResultCode() == MessageTypeEnum.OK) {
42+
System.out.println(getResponse.getMessages().getMessage().get(0).getCode());
43+
System.out.println(getResponse.getMessages().getMessage().get(0).getText());
44+
}
45+
else
46+
{
47+
System.out.println("Failed to get unsettled transaction list: " + getResponse.getMessages().getResultCode());
48+
}
49+
}
50+
return getResponse;
51+
52+
}
5653
}

0 commit comments

Comments
 (0)