/** * Creates a CreditCardFreezer_AuthorizeDotNet object which stores * credit card and billing information and can make charges through * the Authorize.Net payment gateway. * * @param string Authorize.NET API Login ID * @param string Authorize.NET API Transaction Key * @param string Authorize.NET API URL (sandbox, production, etc.) */ public function __construct($loginId, $transactionKey, $postUrl = null) { parent::__construct(); if (!function_exists(curl_init)) { throw new CreditCardFreezer_Exception('php-curl extension does not exist. This extension is required ' . 'by CreditCardFreezer_AuthorizeDotNet.'); } $this->_loginId = $loginId; $this->_transactionKey = $transactionKey; $this->_postUrl = $postUrl; if (!$this->_postUrl) { $this->_postUrl = self::POST_URL; } }
/** * Creates a CreditCardFreezer object and links it to a PDO * data source. * * @param array Optional attributes passed as an array. * @param array Associative array of column mappings, * (attribute constant => string column name) * @return CreditCardFreezer */ public function __construct(PDO $dbh, array $columns = array()) { parent::__construct(); $this->_dbh = $dbh; $this->_pdoDriver = $dbh->getAttribute(PDO::ATTR_DRIVER_NAME); if (!empty($columns)) { $this->_columns = $columns; } else { $columns = $this->_getTextLabels(); foreach ($columns as $attr => $label) { if (in_array($attr, array(self::EXPIRE_YEAR, self::EXPIRE_MONTH, self::NUMBER, self::CCV))) { unset($columns[$attr]); } } $this->_columns = $columns; } }