Skip to content

Commit 8b0d261

Browse files
author
krgupta
committed
Get settled Batch List code
1 parent eae640b commit 8b0d261

1 file changed

Lines changed: 35 additions & 5 deletions

File tree

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,40 @@
1-
package TransactionReporting;
1+
package net.authorize.sample.TransactionReporting;
22

3+
import net.authorize.Environment;
4+
import net.authorize.api.contract.v1.*;
5+
import net.authorize.api.controller.GetSettledBatchListController;
6+
import net.authorize.api.controller.base.ApiOperationBase;
7+
8+
//author @krgupta
39
public class GetSettledBatchList {
410

5-
public static void main(String apiLoginId, String transactionKey) {
6-
// TODO Auto-generated method stub
7-
System.out.println("Get Batch Statistics Sample");
8-
}
11+
public static void run(String apiLoginId, String transactionKey) {
12+
13+
ApiOperationBase.setEnvironment(Environment.SANDBOX);
14+
15+
MerchantAuthenticationType merchantAuthenticationType = new MerchantAuthenticationType() ;
16+
merchantAuthenticationType.setName(apiLoginId);
17+
merchantAuthenticationType.setTransactionKey(transactionKey);
18+
ApiOperationBase.setMerchantAuthentication(merchantAuthenticationType);
19+
20+
GetSettledBatchListRequest getRequest = new GetSettledBatchListRequest();
21+
getRequest.setMerchantAuthentication(merchantAuthenticationType);
22+
GetSettledBatchListController controller = new GetSettledBatchListController(getRequest);
23+
controller.execute();
24+
GetSettledBatchListResponse getResponse = new GetSettledBatchListResponse();
25+
if (getResponse!=null) {
26+
27+
if (getResponse.getMessages().getResultCode() == MessageTypeEnum.OK) {
928

29+
System.out.println(getResponse.getMessages().getMessage().get(0).getCode());
30+
System.out.println(getResponse.getMessages().getMessage().get(0).getText());
31+
}
32+
else
33+
{
34+
System.out.println("Failed to get settled batch list: " + getResponse.getMessages().getResultCode());
35+
}
36+
}
1037
}
38+
}
39+
40+

0 commit comments

Comments
 (0)