Skip to content

PR1992 modified files #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
98 changes: 64 additions & 34 deletions TransactionReporting/get-account-updater-job-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,74 +8,104 @@

function getAccountUpdaterJobDetails()
{
/* Create a merchantAuthenticationType object with authentication details
retrieved from the constants file */
/* Create a merchantAuthenticationType object with authentication details retrieved from the constants file */
$merchantAuthentication = new AnetAPI\MerchantAuthenticationType();
$merchantAuthentication->setName(\SampleCodeConstants::MERCHANT_LOGIN_ID);
$merchantAuthentication->setTransactionKey(\SampleCodeConstants::MERCHANT_TRANSACTION_KEY);

// Set the request's refId
$refId = 'ref' . time();

$refId = '123456';
// Set a valid month (and other parameters) for the request
$month = "2017-07";
$month = "2018-08";
$modifedTypeFilter = "all";
$paging = new AnetAPI\PagingType;
$paging->setLimit("1000");
$paging->setOffset("1");

$paging->setOffset("2");
// Build tbe request object
$request = new AnetAPI\GetAUJobDetailsRequest();
$request->setMerchantAuthentication($merchantAuthentication);
$request->setMonth($month);
$request->setModifiedTypeFilter($modifedTypeFilter);
$request->setPaging($paging);

$controller = new AnetController\GetAUJobDetailsController($request);

// Retrieving details for the given month and parameters
$response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);

if (($response != null) && ($response->getMessages()->getResultCode() == "Ok")) {
echo "SUCCESS: Get Account Updater Details for Month : " . $month . "\n\n";
if ($response->getAuDetails() == null) {
echo "No Account Updater Details for this month.\n";
return ;
echo "No Account Updater Details for this month"."\n";
} else {
$details = new AnetAPI\ListOfAUDetailsType;
$details = $response->getAuDetails();
if (($details->getAuUpdate() == null) && ($details->getAuDelete() == null)) {
echo "No Account Updater Details for this month.\n";
return ;
echo "No Account Updater Details for this month"."\n";
}
}

// Displaying the details of each response in the list
echo "Total Num in Result Set : " . $response->getTotalNumInResultSet() . "\n\n";
$details = new AnetAPI\ListOfAUDetailsType;
$details = $response->getAuDetails();
echo "Updates:\n";
foreach ($details->getAuUpdate() as $update) {
echo " Profile ID / Payment Profile ID : " . $update->getCustomerProfileID() . " / " . $update->getCustomerPaymentProfileID() . "\n";
echo " Update Time (UTC) : " . $update->getUpdateTimeUTC() . "\n";
echo " Reason Code : " . $update->getAuReasonCode() . "\n";
echo " Reason Description : " . $update->getReasonDescription() . "\n";
echo "\n";
echo "Updates:"."\n";
foreach ($details->getAuUpdate() as $update)
{
echo "Profile ID : " . $update->getCustomerProfileID() . "\n";
echo "Payment Profile ID : " . $update->getCustomerPaymentProfileID() . "\n";
echo "Update Time (UTC) : " . $update->getUpdateTimeUTC() . "\n";
echo "Reason Code : " . $update->getAuReasonCode() . "\n";
echo "Reason Description : " . $update->getReasonDescription() . "\n";

if ($update->getNewCreditCard()->getCardNumber() != null)
{
echo "Fetching New Card Details"."\n";
// Fetching New Card Details
echo "Card Number: ". $update->getNewCreditCard()->getCardNumber()."\n";
echo "New Expiration Date: ". $update->getNewCreditCard()->getExpirationDate()."\n";
echo "New Card Type: ". $update->getNewCreditCard()->getCardType()."\n";
}
if ($update->getOldCreditCard()->getCardNumber() != null)
{
echo "Fetching Old Card Details"."\n";
// Fetching Old Card Details
echo "Old Card Number: ". $update->getOldCreditCard()->getCardNumber()."\n";
echo "Old Expiration Date: ".$update->getOldCreditCard()->getExpirationDate()."\n";
echo "Old Card Type: ". $update->getOldCreditCard()->getCardType()."\n";
}
if(!empty($update->getSubscriptionIdList()))
{
echo "Subscription Id : ".implode("",$update->getSubscriptionIdList()). "\n";
}
}
echo "\nDeletes:\n";
foreach ($details->getAuDelete() as $delete) {
echo " Profile ID / Payment Profile ID : " . $delete->getCustomerProfileID() . " / " . $delete->getCustomerPaymentProfileID() . "\n";
echo " Update Time (UTC) : " . $delete->getUpdateTimeUTC() . "\n";
echo " Reason Code : " . $delete->getAuReasonCode() . "\n";
echo " Reason Description : " . $delete->getReasonDescription() . "\n";
echo "\n";
echo "**** AU Update End ****"."\n";
echo "*** AU Deletes:****"."\n";
foreach ($details->getAuDelete() as $delete)
{
echo "Profile ID : " . $delete->getCustomerProfileID() . "\n";
echo "Payment Profile ID : " . $delete->getCustomerPaymentProfileID() . "\n";
echo "Update Time (UTC) : " . $delete->getUpdateTimeUTC() . "\n";
echo "Reason Code : " . $delete->getAuReasonCode() . "\n";
echo "Reason Description : " . $delete->getReasonDescription() . "\n";

if($delete->getCreditCard()->getCardNumber() != null)
{
echo "Fetching Card Details"."\n";
// Fetching New Card Details
echo "Card Number: ". $delete->getCreditCard()->getCardNumber()."\n";
echo "Expiration Date: ". $delete->getCreditCard()->getExpirationDate()."\n";
echo "Card Type: ". $delete->getCreditCard()->getCardType()."\n";
}
if(!empty($delete->getSubscriptionIdList()))
{
echo "Subscription Id :".implode("",$delete->getSubscriptionIdList())."\n";
}
}
} else {
echo "ERROR : Invalid response\n";
}
else
{
echo "ERROR : Invalid response"."\n";
$errorMessages = $response->getMessages()->getMessage();
echo "Response : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText() . "\n";
}

}
return $response;
}

Expand Down
8 changes: 6 additions & 2 deletions test-runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
'PaymentTransactions/',
'TransactionReporting/',
'MobileInappTransactions/',
'VisaCheckout/',
'AcceptSuite/'
'VisaCheckout/'
);

$errorlevel=error_reporting();
Expand Down Expand Up @@ -468,4 +467,9 @@ public static function runGetBatchStatistics()
$response = getBatchStatistics(self::runGetSettledBatchList()->getBatchList()[0]->getBatchId());
return $response;
}
public static function runGetAccountUpdaterJobDetails()
{
$response = getAccountUpdaterJobDetails(self::MERCHANT_LOGIN_ID,self::MERCHANT_TRANSACTION_KEY);
return $response;
}
}