Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/java/net/authorize/sample/SampleCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ private static void ShowMethods()
System.out.println(" GetCustomerPaymentProfileList");
System.out.println(" GetCustomerProfile");
System.out.println(" GetCustomerProfileIds");
System.out.println(" GetCustomerProfileTransactionList");
System.out.println(" GetCustomerShippingAddress");
System.out.println(" GetAcceptCustomerProfilePage");
System.out.println(" UpdateCustomerPaymentProfile");
Expand Down Expand Up @@ -271,6 +272,10 @@ private static void RunMethod(String methodName)
case "GetCustomerProfileIds":
GetCustomerProfileIds.run(apiLoginId, transactionKey);
break;
case "GetCustomerProfileTransactionList":
customerProfileId = "1811474252";
GetCustomerProfileTransactionList.run(apiLoginId, transactionKey, customerProfileId);
break;
case "GetCustomerShippingAddress":
GetCustomerShippingAddress.run(apiLoginId, transactionKey, customerProfileId, customerAddressId);
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package net.authorize.sample.TransactionReporting;

import java.util.List;

import net.authorize.Environment;
import net.authorize.api.contract.v1.*;
import net.authorize.api.controller.GetTransactionListForCustomerController;
import net.authorize.api.controller.base.ApiOperationBase;

//author @akashah
public class GetCustomerProfileTransactionList{

public static ANetApiResponse run(String apiLoginId, String transactionKey, String customerProfileId) {
ApiOperationBase.setEnvironment(Environment.SANDBOX);

MerchantAuthenticationType merchantAuthenticationType = new MerchantAuthenticationType() ;
merchantAuthenticationType.setName(apiLoginId);
merchantAuthenticationType.setTransactionKey(transactionKey);
ApiOperationBase.setMerchantAuthentication(merchantAuthenticationType);


GetTransactionListForCustomerRequest getRequest = new GetTransactionListForCustomerRequest();
getRequest.setMerchantAuthentication(merchantAuthenticationType);
getRequest.setCustomerProfileId(customerProfileId);

Paging paging = new Paging();
paging.setLimit(100);
paging.setOffset(1);

getRequest.setPaging(paging);

TransactionListSorting sorting = new TransactionListSorting();
sorting.setOrderBy(TransactionListOrderFieldEnum.ID);
sorting.setOrderDescending(true);

getRequest.setSorting(sorting);

GetTransactionListForCustomerController controller = new GetTransactionListForCustomerController(getRequest);
controller.execute();

GetTransactionListResponse getResponse = controller.getApiResponse();
if (getResponse!=null) {
ArrayOfTransactionSummaryType transactions = getResponse.getTransactions();
List<TransactionSummaryType> list = transactions.getTransaction();

for(TransactionSummaryType summary : list)
{
System.out.println(summary.getFirstName());
System.out.println(summary.getTransId());
System.out.println(summary.getSettleAmount());
System.out.println(summary.getSubmitTimeLocal());
}

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 transaction list: " + getResponse.getMessages().getResultCode());
}
}
return getResponse;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ PaymentTransactions.UpdateSplitTenderGroup 0 1
PaymentTransactions.UpdateHeldTransation 0 0
PaymentTransactions.GetAnAcceptPaymentPage 1 1
TransactionReporting.GetTransactionList 0 1
TransactionReporting.GetTransactionListForCustomer 1 1
TransactionReporting.GetUnsettledTransactionList 0 1
TransactionReporting.GetBatchStatistics 0 1
TransactionReporting.GetSettledBatchList 0 1
Expand Down