Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
4 changes: 4 additions & 0 deletions SampleCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ private static void ShowMethods()
Console.WriteLine(" GetAnAcceptPaymentPage");
Console.WriteLine(" GetCustomerProfileTransactionList");
Console.WriteLine(" GetAccountUpdaterJobSummary");
Console.WriteLine(" GetAccountUpdaterJobDetails");
}

private static void RunMethod(String methodName)
Expand Down Expand Up @@ -335,6 +336,9 @@ private static void RunMethod(String methodName)
//case "GetAccountUpdaterJobSummary":
// GetAccountUpdaterJobSummary.Run(apiLoginId, transactionKey);
// break;
case "GetAccountUpdaterJobDetails":
GetAccountUpdaterJobDetails.Run(apiLoginId, transactionKey);
break;
default:
ShowUsage();
break;
Expand Down
1 change: 1 addition & 0 deletions SampleCode.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
<Compile Include="RecurringBilling\GetSubscriptionStatus.cs" />
<Compile Include="RecurringBilling\UpdateSubscription.cs" />
<Compile Include="SampleCode.cs" />
<Compile Include="TransactionReporting\GetAccountUpdaterJobDetails.cs" />
<Compile Include="TransactionReporting\GetBatchStatistics.cs" />
<Compile Include="TransactionReporting\GetMerchantDetails.cs" />
<Compile Include="TransactionReporting\GetSettledBatchList.cs" />
Expand Down
4 changes: 4 additions & 0 deletions SampleCodeTest/TestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,9 @@ public ANetApiResponse TestGetAnAcceptPaymentPage()
//{
// return GetAccountUpdaterJobSummary.Run(apiLoginId, transactionKey);
//}
public ANetApiResponse TestGetAccountUpdaterJobDetails()
{
return GetAccountUpdaterJobDetails.Run(apiLoginId, transactionKey);
}
}
}
92 changes: 72 additions & 20 deletions TransactionReporting/GetAccountUpdaterJobDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using AuthorizeNet.Api.Contracts.V1;
using AuthorizeNet.Api.Controllers;
using AuthorizeNet.Api.Controllers.Bases;
using System.Collections;

namespace net.authorize.sample
{
Expand All @@ -26,51 +27,102 @@ public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey)

// parameters for request
string month = "2017-06";
string modifiedTypeFilter = "all"

var request = new getAccountUpdaterJobDetailsRequest();
string modifiedTypeFilter = "all";
string refId = "123456";
var request = new getAUJobDetailsRequest();
request.month = month;
request.modifiedTypeFilter = modifiedTypeFilter;
request.modifiedTypeFilter = AUJobTypeEnum.all;
request.refId = refId;
request.paging = new Paging
{
limit = 1000,
limit = 100,
offset = 1
};

// instantiate the controller that will call the service
var controller = new getAccountUpdaterJobDetailsController(request);
var controller = new getAUJobDetailsController(request);
controller.Execute();

// get the response from the service (errors contained if any)
var response = controller.GetApiResponse();

if (response != null && response.messages.resultCode == messageTypeEnum.Ok)
{
Console.WriteLine("SUCCESS: Get Account Updater job details for Month : " + month);
if (response.auDetails == null)
return response;

foreach (var update in response.auDetails.auUpdate)
{
Console.WriteLine("Profile ID / Payment Profile ID: {0} / {1}", update.customerProfileID, update.customerPaymentProfileID);
Console.WriteLine("Update Time (UTC): {0}", update.updateTimeUTC);
Console.WriteLine("Reason Code: {0}", update.auReasonCode);
Console.WriteLine("Reason Description: {0}", update.reasonDescription);
Console.WriteLine("No GetAccountUpdaterjobdetails for this month");
return response;
}

foreach (var delete in response.auDetails.auDelete)
// Displaying the Audetails of each response in the list
foreach (var details in response.auDetails)
{
Console.WriteLine("Profile ID / Payment Profile ID: {0} / {1}", delete.customerProfileID, update.customerPaymentProfileID);
Console.WriteLine("Update Time (UTC): {0}", delete.updateTimeUTC);
Console.WriteLine("Reason Code: {0}", delete.auReasonCode);
Console.WriteLine("Reason Description: {0}", delete.reasonDescription);


Console.WriteLine(" **** Customer profile details Start ****");
Console.WriteLine("Profile ID / Payment Profile ID: {0} / {1}", details.customerProfileID, details.customerPaymentProfileID);
Console.WriteLine("FirstName LastName : {0} / {1}", details.firstName, details.lastName);
Console.WriteLine("Update Time (UTC): {0}", details.updateTimeUTC);
Console.WriteLine("Reason Code: {0}", details.auReasonCode);
Console.WriteLine("Reason Description: {0}", details.reasonDescription);


if (details is auUpdateType)
{
for (int i = 0; i < ((auUpdateType)details).subscriptionIdList.Length; i++)
{
Console.WriteLine("SubscriptionIdList: {0}", ((auUpdateType)details).subscriptionIdList[i]);
}
}
else if (details is auDeleteType)
{
for (int i = 0; i < ((auDeleteType)details).subscriptionIdList.Length; i++)
{
Console.WriteLine("SubscriptionIdList: {0}", ((auDeleteType)details).subscriptionIdList[i]);
}
}


if (details.GetType().GetField("newCreditCard") != null)
{
Console.WriteLine("Fetching New Card Details");
// Fetching New Card Details
var newCreditCard = details.GetType().GetField("newCreditCard").GetValue(details);
creditCardMaskedType newCreditCardMaskedType = (creditCardMaskedType)newCreditCard;
Console.WriteLine("Card Number: {0}", newCreditCardMaskedType.cardNumber);
Console.WriteLine("New Expiration Date: {0}", newCreditCardMaskedType.expirationDate);
Console.WriteLine("New Card Type: {0}", newCreditCardMaskedType.cardType);

}

if (details.GetType().GetField("oldCreditCard") != null)
{
Console.WriteLine("Fetching Old Card Details");
// Fetching Old Card Details
var oldCreditCard = details.GetType().GetField("oldCreditCard").GetValue(details);
creditCardMaskedType oldCreditCardMaskedType = (creditCardMaskedType)oldCreditCard;
Console.WriteLine("Old Card Number: {0}", oldCreditCardMaskedType.cardNumber);
Console.WriteLine("Old Expiration Date: {0}", oldCreditCardMaskedType.expirationDate);
Console.WriteLine("Old Card Type: {0}", oldCreditCardMaskedType.cardType);

Console.WriteLine("**** Customer Profile Details End ****");
}
}

}

else if (response != null)
{
Console.WriteLine("Error: " + response.messages.message[0].code + " " +
response.messages.message[0].text);
response.messages.message[0].text);
}
else if (response == null)
{
var errResponse = controller.GetErrorResponse();
Console.WriteLine("Error: " + errResponse.messages.message[0].code + " " +
response.messages.message[0].text);
}

return response;
}
}
Expand Down