Here is the situation:
I'm trying to build a custom report with the API for my client. I do not have SSH access, so I'm trying to load the SDK over FTP.
Initially I tried just loading the SDK files from github, but could not get that to work. Finally, I loaded composer on a different server, installed the SDK with composer, copied down the 'vendor' directory and loaded that into my project.
Now, I get this error:
Fatal error: Class 'Goetas\Xsd\XsdToPhp\Jms\Handler\BaseTypesHandler' not found in /path/to/project/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/base/ApiOperationBase.php on line 79
According to recordnotfound.com, there was an open issue for this exact problem but it has been closed. However, I can't find anything on how the issue was resolved.
EDIT: Found the closed ticket on github. LINK
Just for fun, here is the code I'm trying to run:
<?php error_reporting(-1); ini_set('display_errors', 'On'); date_default_timezone_set('America/Chicago'); require 'vendor/autoload.php'; use net\authorize\api\contract\v1 as AnetAPI; use net\authorize\api\controller as AnetController; $start_datetime = ""; $end_datetime = ""; $start = '2016-05-01 00:00:00'; $end = '2016-05-31 00:00:00'; function create_authnet_timestamp($userdate){ $stamp = strtotime($userdate); $date = date("Y-m-d", $stamp); $time = date("H:i:s", $stamp); $datetime = $date."T".$time."Z"; return $datetime; } if($start != '' && $start != NULL && is_real_date($start) ){ $start_datetime = create_authnet_timestamp($start); } if($end != '' && $end != NULL && is_real_date($end) ){ $end_datetime = create_authnet_timestamp($end); } function getSettledBatchList($startDate, $endDate) { $api_id = "MY_API_ID"; $account_key = "MY_TRANSACTION_ID"; $batch_array = array(); $start_dt = new DateTime($startDate); $end_dt = new DateTime($endDate); $merchAuth = new AnetAPI\MerchantAuthenticationType(); $merchAuth->setName($api_id); $merchAuth->setTransactionKey($account_key); $request = new AnetAPI\GetSettledBatchListRequest(); $request->setMerchantAuthentication($merchAuth); $request->setIncludeStatistics(true); $request->setFirstSettlementDate($start_dt); $request->setLastSettlementDate($end_dt); $controller = new AnetController\GetSettledBatchListController($request); $response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX); if(($response != null) && ($response->getMessages()->getResultCode() == "Ok")){ return $response; }else{ $errorMessages = $response->getMessages()->getMessage(); echo "Response : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText() . "\n"; return false; } } $api_response = getSettledBatchList($start_datetime, $end_datetime); var_dump($api_response); ?>
I'm starting to pull my hair out a little. Can anyone help?
Solved! Go to Solution.
05-22-2016 01:51 PM - edited 05-22-2016 02:00 PM