/**
  * Fills object with all standard items of a Notification record
  *
  * @param  cbpaidPayHandler     $payHandler
  * @param  int                  $test_ipn
  * @param  string               $log_type
  * @param  string               $paymentStatus
  * @param  string               $paymentType
  * @param  string               $reasonCode
  * @param  int                  $paymentTime
  * @param  string               $charset
  */
 public function initNotification($payHandler, $test_ipn, $log_type, $paymentStatus, $paymentType, $reasonCode, $paymentTime, $charset = 'utf-8')
 {
     $this->payment_method = $payHandler->getPayName();
     $this->gateway_account = $payHandler->getAccountParam('id');
     $this->log_type = $log_type;
     $this->time_received = Application::Database()->getUtcDateTime();
     $this->ip_addresses = cbpaidRequest::getIPlist();
     $this->geo_ip_country_code = cbpaidRequest::getGeoIpCountryCode();
     $this->notify_version = '2.1';
     $this->user_id = (int) cbGetParam($_GET, 'user', 0);
     $this->charset = $charset;
     $this->test_ipn = $test_ipn;
     $this->payer_status = 'unverified';
     $this->payment_status = $paymentStatus;
     if (in_array($paymentStatus, array('Completed', 'Pending', 'Processed', 'Failed', 'Reversed', 'Refunded', 'Partially-Refunded', 'Canceled_Reversal'))) {
         if (in_array($paymentStatus, array('Completed', 'Reversed', 'Refunded', 'Partially-Refunded', 'Canceled_Reversal'))) {
             $this->payment_date = gmdate('H:i:s M d, Y T', $paymentTime);
             // paypal-style
         }
         $this->payment_type = $paymentType;
     }
     if ($reasonCode) {
         $this->reason_code = $reasonCode;
     }
 }
 /**
  * Constructor
  * 
  * @param  cbpaidGatewayAccount        $account
  */
 public function __construct($account)
 {
     global $_CB_framework;
     parent::__construct($account);
     $this->_gatewayUrls = array('psp+normal' => $this->getAccountParam('psp_normal_url'), 'psp+test' => $this->getAccountParam('psp_test_url'));
     if ($_CB_framework->outputCharset() == 'UTF-8') {
         foreach ($this->_gatewayUrls as $k => $v) {
             $this->_gatewayUrls[$k] = str_replace('orderstandard.asp', 'orderstandard_utf8.asp', $v);
         }
     }
 }
	/**
	 * Gets payment mean handler
	 *
	 * @param  string                     $methodCheck
	 * @return cbpaidPayHandler|boolean
	 */
	public function & getPayMean( $methodCheck = null ) {
		if ( $this->_payHandler === null ) {
			$name				=	$this->getPayMeanName();
			if ( ! $name ) {
				$false				=	false;
				return $false;
			}
			$className			=	'cbpaid' . $name;
			if ( ! class_exists( $className ) ) {
				cbpaidApp::import( 'processors.' . $name . '.' . $name );
			}
			$this->_payHandler	=	new $className( $this );
		}
		if ( ( $methodCheck === null ) || ( $methodCheck == $this->_payHandler->getPayName() ) ) {
			return $this->_payHandler;
		} else {
			$false				=	false;
			return $false;
		}
	}