Esempio n. 1
0
 /**
  * Returns the instance of AuthorizeNetCIM class.
  *
  * @since     3.5
  *
  * @access    protected
  * @staticvar AuthorizeNetCIM $cim The instance of AuthorizeNetCIM class.
  * @return AuthorizeNetCIM The instance of AuthorizeNetCIM class.
  */
 protected function _get_cim()
 {
     static $cim = null;
     if (!is_null($cim)) {
         return $cim;
     }
     require_once MEMBERSHIP_ABSPATH . '/classes/Authorize.net/AuthorizeNet.php';
     // merchant information
     $login_id = $this->_get_option('api_user');
     $transaction_key = $this->_get_option('api_key');
     $mode = $this->_get_option('mode', self::MODE_SANDBOX);
     $cim = new AuthorizeNetCIM($login_id, $transaction_key);
     $cim->setSandbox($mode != self::MODE_LIVE);
     if (defined('MEMBERSHIP_AUTHORIZE_LOGFILE')) {
         $cim->setLogFile(MEMBERSHIP_AUTHORIZE_LOGFILE);
     }
     return $cim;
 }