private function computeTotalCost(Pap_Contexts_Action $context) { $context->debug('Recognizing totalCost currency started'); $defaultCurrency = $this->getDefaultCurrency(); $context->debug(" Default currency is ".$defaultCurrency->getName()); $context->set("defaultCurrencyObject", $defaultCurrency); $context->setRealTotalCost($context->getTotalCostFromRequest()); $context->debug('Setting realTotalCost to '.$context->getTotalCostFromRequest()); if ($context->getCurrencyFromRequest() != '') { Gpf_Plugins_Engine::extensionPoint('Tracker.action.computeTotalCost', $context); } $context->debug('Recognizing totalCost currency ended. totalCost: '.$context->getRealTotalCost()); $context->debug(""); return Gpf_Plugins_Engine::PROCESS_CONTINUE; }
public function process(Pap_Contexts_Action $context) { $context->debug('Started checking md5 checksums'); $checksum = $context->getExtraDataFromRequest(Gpf_Settings::get(SaleFraudProtection_Config::PARAM_NAME)); $myChecksum = $this->createCheckSum($context->getTotalCostFromRequest(), $context->getOrderIdFromRequest()); if ($checksum == $myChecksum) { $context->debug('Checkings md5 checksums finished. Checksums equals.'); return; } $context->debug('Checking md5 checksums failed. Transaction not saved. Checksums: '.$checksum.' - '.$myChecksum); $context->setDoCommissionsSave(false); }