Ejemplo n.º 1
0
 /**
  * Get message 
  *
  * @return string
  */
 public function getMessage()
 {
     $message = \XLite\Model\Payment\Transaction::getDefaultFailedReason();
     if (\XLite\Core\Request::getInstance()->message) {
         $message = urldecode(\XLite\Core\Request::getInstance()->message);
     }
     return $message;
 }
Ejemplo n.º 2
0
 /**
  * Add top message about transaction results
  *
  * @return void
  */
 protected function assignTransactionMessage()
 {
     $txnNote = \XLite\Core\Request::getInstance()->txnNote ? base64_decode(\XLite\Core\Request::getInstance()->txnNote) : null;
     $txnNoteType = \XLite\Core\Request::getInstance()->txnNoteType;
     if ($txnNote) {
         $message = strip_tags($txnNote);
         if (\XLite\Core\TopMessage::ERROR == $txnNoteType) {
             if (\XLite\Model\Payment\Transaction::getDefaultFailedReason() == $txnNote) {
                 // Display default message
                 \XLite\Core\TopMessage::addError($message);
             } else {
                 // Display specific transaction message
                 \XLite\Core\TopMessage::addError($this->getCommonErrorMessage(), array('txnNote' => $message));
             }
         } else {
             // Display transaction success message
             \XLite\Core\TopMessage::addInfo($message);
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * Returns default fa
  *
  * @return string
  */
 protected function getDefaultFailureReason()
 {
     return \XLite\Model\Payment\Transaction::getDefaultFailedReason();
 }
Ejemplo n.º 4
0
 /**
  * Compose error message from message and code
  * (It's here for the regexp in the next method)
  *
  * @param string $code Error code
  * @param string $message Error message
  *
  * @return string 
  */
 public function composeErrorMessage($code = '', $message = '')
 {
     $error = '';
     if ($code) {
         $error = 'X-Payments error (code: ' . $code . ') ';
         if ($message) {
             $error .= ' ' . $message;
         }
     } elseif ($message) {
         $error = $message;
     } else {
         $error = \XLite\Model\Payment\Transaction::getDefaultFailedReason();
     }
     return $error;
 }