/** * Renders SUCCESS or ERROR based on RatePAY Resultcodes * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { switch ($row->getResultCode()) { case '350': // PAYMENT_INIT // PAYMENT_INIT case '402': // PAYMENT_REQUEST // PAYMENT_REQUEST case '400': // PAYMENT_CONFIRM // PAYMENT_CONFIRM case '403': // PAYMENT_CHANGE // PAYMENT_CHANGE case '404': // CONFIRMATION_DELIVER // CONFIRMATION_DELIVER case '500': // CALCULATION_REQUEST return 'SUCCESS'; default: return 'ERROR'; } }
/** * 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 * * @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()); } }