/**
  * Constructor.
  *
  * @param \net\authorize\api\contract\v1\AnetApiRequestType $request ApiRequest to send
  * @param string $responseType response type expected
  * @throws InvalidArgumentException if invalid request
  */
 public function __construct(\net\authorize\api\contract\v1\AnetApiRequestType $request, $responseType)
 {
     date_default_timezone_set('UTC');
     $this->logger = LogFactory::getLog(get_class($this));
     if (null == $request) {
         throw new InvalidArgumentException("request cannot be null");
     }
     if (null == $responseType || '' == $responseType) {
         throw new InvalidArgumentException("responseType cannot be null or empty");
     }
     if (null != $this->apiResponse) {
         throw new InvalidArgumentException("response has to be null");
     }
     $this->apiRequest = $request;
     $this->validate();
     $this->apiResponseType = $responseType;
     $this->httpClient = new HttpClient();
     $serializerBuilder = SerializerBuilder::create();
     $serializerBuilder->addMetadataDir(__DIR__ . '/../../yml/v1', 'net\\authorize\\api\\contract\\v1');
     //..\..\yml\v1\ //'/../lib/net/authorize/api/yml/v1'
     $serializerBuilder->configureHandlers(function (HandlerRegistryInterface $h) use($serializerBuilder) {
         $serializerBuilder->addDefaultHandlers();
         $h->registerSubscribingHandler(new BaseTypesHandler());
         // XMLSchema List handling
         $h->registerSubscribingHandler(new XmlSchemaDateHandler());
         // XMLSchema date handling
     });
     $this->serializer = $serializerBuilder->build();
 }
Example #2
0
 /**
  * Constructor.
  *
  * @param string $api_login_id       The Merchant's API Login ID.
  * @param string $transaction_key The Merchant's Transaction Key.
  */
 public function __construct($api_login_id = false, $transaction_key = false)
 {
     $this->_api_login = $api_login_id ? $api_login_id : (defined('AUTHORIZENET_API_LOGIN_ID') ? AUTHORIZENET_API_LOGIN_ID : "");
     $this->_transaction_key = $transaction_key ? $transaction_key : (defined('AUTHORIZENET_TRANSACTION_KEY') ? AUTHORIZENET_TRANSACTION_KEY : "");
     $this->_sandbox = defined('AUTHORIZENET_SANDBOX') ? AUTHORIZENET_SANDBOX : true;
     $this->_logger = LogFactory::getLog(get_class($this));
 }
Example #3
0
 /**
  * Constructor.
  *
  */
 public function __construct()
 {
     $this->logger = LogFactory::getLog(get_class($this));
     date_default_timezone_set('UTC');
 }
Example #4
0
 /**
  * Constructor.
  *
  */
 public function __construct()
 {
     $this->_log_file = defined('AUTHORIZENET_LOG_FILE') ? AUTHORIZENET_LOG_FILE : false;
     $this->logger = LogFactory::getLog(get_class($this));
     date_default_timezone_set('UTC');
 }