Example #1
0
 /**
  * Enter description here ...
  * @param Varien_Object $result
  * @param Mage_Core_Model_Config_Data $configData
  * @param array $paths
  */
 public function checkIfPathsChanged($result, $configData, $paths)
 {
     $storeId = $configData->getStoreCode() ? Mage::app()->getStore($configData->getStoreCode())->getId() : 0;
     $this->_changingValues[$storeId . '/' . $configData->getPath()] = $configData->getValue();
     if (!$result->getIsChanged() && in_array($configData->getPath(), $paths) && Mage::getStoreConfig($configData->getPath(), $storeId) != $configData->getValue()) {
         $result->setIsChanged(true);
     }
 }
 /**
  * Operate with order or quote using information from silent post
  *
  * @param Varien_Object $document
  */
 protected function _process(Varien_Object $document)
 {
     $response = $this->getResponse();
     $payment = $document->getPayment();
     if ($response->getResult() == self::RESPONSE_CODE_FRAUDSERVICE_FILTER || $response->getResult() == self::RESPONSE_CODE_DECLINED_BY_FILTER) {
         $fraudMessage = $this->_getFraudMessage() ? $response->getFraudMessage() : $response->getRespmsg();
         $payment->setAdditionalInformation('paypal_fraud_filters', $fraudMessage);
     }
     if ($response->getAvsdata() && strstr(substr($response->getAvsdata(), 0, 2), 'N')) {
         $payment->setAdditionalInformation('paypal_avs_code', substr($response->getAvsdata(), 0, 2));
     }
     if ($response->getCvv2match() && $response->getCvv2match() != 'Y') {
         $payment->setAdditionalInformation('paypal_cvv2_match', $response->getCvv2match());
     }
     $payment->setAdditionalInformation('authorization_id', $response->getPnref());
     /** @var $transaction Mage_Paypal_Model_Payment_Transaction */
     $transaction = Mage::getModel('paypal/payment_transaction');
     $transaction->setTxnId($response->getPnref());
     $transaction->setAdditionalInformation('amt', $response->getAmt());
     $transaction->setAdditionalInformation('store_id', $document->getStoreId());
     $document->setIsChanged(1);
     $document->save();
     $transaction->save();
 }