Skip to content

Commit 1614d1d

Browse files
committed
Modified SampleCode.java
1 parent 907affc commit 1614d1d

File tree

4 files changed

+39
-11
lines changed

4 files changed

+39
-11
lines changed

src/main/java/net/authorize/sample/SampleCode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private static void ShowMethods()
9090
System.out.println(" UpdateSubscription");
9191
System.out.println(" GetListSubscription");
9292
System.out.println(" GetBatchStatistics");
93-
//System.out.println(" GetSettledBatchList");
93+
System.out.println(" GetSettledBatchList");
9494
System.out.println(" GetTransactionList");
9595
System.out.println(" GetUnsettledTransactionList");
9696
System.out.println(" GetTransactionDetails");
@@ -174,9 +174,9 @@ private static void RunMethod(String methodName)
174174
case "GetBatchStatistics":
175175
GetBatchStatistics.run(apiLoginId, transactionKey);
176176
break;
177-
/*case "GetSettledBatchList":
177+
case "GetSettledBatchList":
178178
GetSettledBatchList.run(apiLoginId, transactionKey);
179-
break;*/
179+
break;
180180
case "GetTransactionList":
181181
GetTransactionList.run(apiLoginId, transactionKey);
182182
break;
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+

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package net.authorize.sample.TransactionReporting;
22

3-
43
import net.authorize.Environment;
54
import net.authorize.api.contract.v1.*;
6-
75
import net.authorize.api.controller.GetSettledBatchListController;
86
import net.authorize.api.controller.GetUnsettledTransactionListController;
97
import net.authorize.api.controller.base.ApiOperationBase;

target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ net\authorize\sample\CustomerProfiles\CreateCustomerProfilePaymentProfile.class
33
net\authorize\sample\TransactionReporting\GetUnsettledTransactionList.class
44
net\authorize\sample\RecurringBilling\GetSubscriptionStatus.class
55
net\authorize\sample\CustomerProfiles\DeleteCustomerShippingAddress.class
6+
net\authorize\sample\TransactionReporting\GetSettledBatchList.class
67
net\authorize\sample\SampleCode.class
78
net\authorize\sample\PaymentTransactions\CreditBankAccount.class
89
net\authorize\sample\CustomerProfiles\DeleteCustomerProfile.class
@@ -34,6 +35,5 @@ net\authorize\sample\PaymentTransactions\AuthorizeCreditCard.class
3435
net\authorize\sample\CustomerProfiles\CreateCustomerShippingAddress.class
3536
net\authorize\sample\PaymentTransactions\ChargeCreditCard.class
3637
net\authorize\sample\CustomerProfiles\GetHostedProfilePage.class
37-
TransactionReporting\GetSettledBatchList.class
3838
net\authorize\sample\CustomerProfiles\DeleteCustomerPaymentProfile.class
3939
net\authorize\sample\CustomerProfiles\ValidateCustomerPaymentProfile.class

0 commit comments

Comments
 (0)