/**
  * @param AbstractTransaction $transaction
  */
 public function __construct(AbstractTransaction $transaction)
 {
     $this->transaction = $transaction;
     if ($transaction->getConfig()->getEnvironment() == Config::ENV_LIVE) {
         $this->config['host'] = 'www3.moneris.com';
     }
 }
 /**
  * Force order for this transaction (!)
  *
  * @return array
  */
 public function validate()
 {
     $errors = parent::validate();
     if (count($errors) == 0) {
         $this->params = array('order_id' => $this->params['order_id'], 'comp_amount' => $this->params['comp_amount'], 'txn_number' => $this->params['txn_number']);
     }
     return $errors;
 }
 /**
  * @param Config $config
  * @param array $params
  */
 public function __construct(Config $config, array $params)
 {
     parent::__construct('purchase', $config, $params);
     $this->requiredParams = array('order_id', 'pan', 'amount', 'expdate');
 }
 /**
  * @param Config $config
  * @param array $params
  */
 public function __construct(Config $config, array $params)
 {
     parent::__construct('cc_test', $config, $params);
     $this->requiredParams = array('pan', 'exp_date');
 }
 /**
  * @param Config $config
  * @param array $params
  */
 public function __construct(Config $config, array $params)
 {
     parent::__construct('res_add_token', $config, $params);
     $this->requiredParams = array('data_key', 'expdate');
 }
 /**
  * @param Config $config
  * @param array $params
  */
 public function __construct(Config $config, array $params)
 {
     parent::__construct('res_preauth_cc', $config, $params);
     $this->requiredParams = array('order_id', 'data_key', 'amount', 'expdate');
 }