/**
  * If response is failed throw exception
  * Set token data in payment object
  *
  * @param Varien_Object $response
  * @param Mage_Sales_Model_Order_Payment $payment
  * @throws Mage_Core_Exception
  */
 protected function _processTokenErrors($response, $payment)
 {
     if (!$response->getSecuretoken() && $response->getResult() != self::RESPONSE_CODE_APPROVED && $response->getResult() != self::RESPONSE_CODE_FRAUDSERVICE_FILTER) {
         Mage::throwException($response->getRespmsg());
     } else {
         $payment->setAdditionalInformation('secure_token_id', $response->getSecuretokenid())->setAdditionalInformation('secure_token', $response->getSecuretoken());
     }
 }
Example #2
0
 /**
  * If response is failed throw exception
  *
  * @throws Mage_Core_Exception
  */
 protected function _processErrors(Varien_Object $response)
 {
     if ($response->getResultCode() != self::RESPONSE_CODE_APPROVED && $response->getResultCode() != self::RESPONSE_CODE_FRAUDSERVICE_FILTER) {
         Mage::throwException($response->getRespmsg());
     }
 }
 /**
  * If response is failed throw exception
  *
  * @throws Mage_Core_Exception
  */
 protected function _processErrors(Varien_Object $response)
 {
     if ($response->getResultCode() == self::RESPONSE_CODE_VOID_ERROR) {
         throw new Mage_Paypal_Exception(Mage::helper('paypal')->__('You cannot void a verification transaction'));
     } elseif ($response->getResultCode() != self::RESPONSE_CODE_APPROVED && $response->getResultCode() != self::RESPONSE_CODE_FRAUDSERVICE_FILTER) {
         Mage::throwException($response->getRespmsg());
     }
 }
 /**
  * If response is failed throw exception
  * Set token data in payment object
  *
  * @param Varien_Object $response
  * @param Mage_Sales_Model_Order_Payment $payment
  * @throws Mage_Core_Exception
  */
 protected function _processTokenErrors($response, $payment)
 {
     if ($response->getResult() == self::RESPONSE_CODE_INVALID_AMOUNT) {
         throw new Mage_Paypal_Exception(Mage::helper('paypal')->__('Invalid Amount'));
     } elseif (!$response->getSecuretoken() && $response->getResult() != self::RESPONSE_CODE_APPROVED && $response->getResult() != self::RESPONSE_CODE_FRAUDSERVICE_FILTER) {
         Mage::throwException($response->getRespmsg());
     } else {
         $payment->setAdditionalInformation('secure_token_id', $response->getSecuretokenid())->setAdditionalInformation('secure_token', $response->getSecuretoken());
     }
 }