Ejemplo n.º 1
0
 /**
  * Logs the request.
  *
  * @param string $type Log type (info, payment, cancel, error)
  * @param string $message Log message
  * @param array $extra Extra details to log (not including output from getLogDetails)
  */
 public function log($type, $message, array $extra)
 {
     $upgradeRecordId = $this->getUpgradeRecordId();
     $processor = $this->getProcessorId();
     $transactionId = $this->getTransactionId();
     $details = $this->getLogDetails() + $extra;
     $this->_upgradeModel->logProcessorCallback($upgradeRecordId, $processor, $transactionId, $type, $message, $details);
 }
Ejemplo n.º 2
0
 /**
  * Once all conditions are validated, process the transaction.
  *
  * @return array [0] => log type (payment, cancel, info), [1] => log message
  */
 public function processTransaction()
 {
     switch ($this->_filtered['type']) {
         case self::PAYMENT_CHARGE_BACK:
             if ($this->_upgradeRecord) {
                 $this->_upgradeModel->downgradeUserUpgrade($this->_upgradeRecord);
                 return array('cancel', 'OK');
             }
             break;
         default:
             $this->_upgradeRecordId = $this->_upgradeModel->upgradeUser($this->_user['user_id'], $this->_upgrade);
             return array('payment', 'OK');
     }
     $this->alreadyprocessed = true;
     return array('info', 'OK, no action');
 }