diff --git a/src/main/java/net/authorize/sample/TransactionReporting/GetUnsettledTransactionList.java b/src/main/java/net/authorize/sample/TransactionReporting/GetUnsettledTransactionList.java index 30db6265..72b8b237 100644 --- a/src/main/java/net/authorize/sample/TransactionReporting/GetUnsettledTransactionList.java +++ b/src/main/java/net/authorize/sample/TransactionReporting/GetUnsettledTransactionList.java @@ -9,48 +9,45 @@ //author @krgupta public class GetUnsettledTransactionList{ - - public static ANetApiResponse run(String apiLoginId, String transactionKey) { - ApiOperationBase.setEnvironment(Environment.SANDBOX); + public static ANetApiResponse run(String apiLoginId, String transactionKey) { + ApiOperationBase.setEnvironment(Environment.SANDBOX); - MerchantAuthenticationType merchantAuthenticationType = new MerchantAuthenticationType() ; - merchantAuthenticationType.setName(apiLoginId); - merchantAuthenticationType.setTransactionKey(transactionKey); - ApiOperationBase.setMerchantAuthentication(merchantAuthenticationType); + MerchantAuthenticationType merchantAuthenticationType = new MerchantAuthenticationType() ; + merchantAuthenticationType.setName(apiLoginId); + merchantAuthenticationType.setTransactionKey(transactionKey); + ApiOperationBase.setMerchantAuthentication(merchantAuthenticationType); - GetUnsettledTransactionListRequest getRequest = new GetUnsettledTransactionListRequest(); - getRequest.setMerchantAuthentication(merchantAuthenticationType); - getRequest.setStatus(TransactionGroupStatusEnum.ANY); + GetUnsettledTransactionListRequest getRequest = new GetUnsettledTransactionListRequest(); + getRequest.setMerchantAuthentication(merchantAuthenticationType); + getRequest.setStatus(TransactionGroupStatusEnum.ANY); - Paging paging = new Paging(); - paging.setLimit(100); - paging.setOffset(1); + Paging paging = new Paging(); + paging.setLimit(100); + paging.setOffset(1); - getRequest.setPaging(paging); + getRequest.setPaging(paging); - TransactionListSorting sorting = new TransactionListSorting(); - sorting.setOrderBy(TransactionListOrderFieldEnum.ID); - sorting.setOrderDescending(true); + TransactionListSorting sorting = new TransactionListSorting(); + sorting.setOrderBy(TransactionListOrderFieldEnum.ID); + sorting.setOrderDescending(true); - getRequest.setSorting(sorting); - - GetUnsettledTransactionListController controller = new GetUnsettledTransactionListController(getRequest); - controller.execute(); - GetUnsettledTransactionListResponse getResponse = controller.getApiResponse(); - - if (getResponse!=null) { - - if (getResponse.getMessages().getResultCode() == MessageTypeEnum.OK) { - - System.out.println(getResponse.getMessages().getMessage().get(0).getCode()); - System.out.println(getResponse.getMessages().getMessage().get(0).getText()); - } - else - { - System.out.println("Failed to get unsettled transaction list: " + getResponse.getMessages().getResultCode()); - } - } - return getResponse; - - } + getRequest.setSorting(sorting); + + GetUnsettledTransactionListController controller = new GetUnsettledTransactionListController(getRequest); + controller.execute(); + GetUnsettledTransactionListResponse getResponse = controller.getApiResponse(); + + if (getResponse!=null) { + if (getResponse.getMessages().getResultCode() == MessageTypeEnum.OK) { + System.out.println(getResponse.getMessages().getMessage().get(0).getCode()); + System.out.println(getResponse.getMessages().getMessage().get(0).getText()); + } + else + { + System.out.println("Failed to get unsettled transaction list: " + getResponse.getMessages().getResultCode()); + } + } + return getResponse; + + } }