public function processInput($data) { $custom = isset($data['custom']) ? rawurldecode($data['custom']) : null; $data = Kwf_Util_PayPal_Ipn_LogModel::decodeCallback($custom); if ($data) { $db = Kwf_Registry::get('db'); $date = date('Y-m-d H:i:s'); $sql = "UPDATE `kwc_shop_orders` SET\n `payment_component_id` = {$db->quote($this->getData()->parent->componentId)},\n `checkout_component_id` = {$db->quote($this->getData()->parent->parent->componentId)},\n `cart_component_class` = {$db->quote($this->getData()->parent->parent->parent->componentClass)},\n `date` = {$db->quote($date)},\n `status` = 'ordered'\n WHERE `id` = {$db->quote($data['data']['orderId'])} AND (`status` = 'processing' OR `status` = 'cart')"; $db->query($sql); Kwc_Shop_Cart_Orders::setOverriddenCartOrderId($data['data']['orderId']); if (Kwc_Shop_Cart_Orders::getCartOrderId() == $data['data']['orderId']) { Kwc_Shop_Cart_Orders::resetCartOrderId(); } } }
protected function _afterInsert() { parent::_afterInsert(); $c = Kwf_Util_PayPal_Ipn_LogModel::decodeCallback($this->custom); if ($c && $c['cb']) { $ret = false; if (Kwf_Loader::isValidClass($c['cb'])) { $ret = call_user_func(array($c['cb'], 'processIpn'), $this, $c['data']); } else { if (Kwf_Component_Data_Root::getComponentClass()) { $component = Kwf_Component_Data_Root::getInstance()->getComponentById($c['cb']); if ($component) { $ret = $component->getComponent()->processIpn($this, $c['data']); } } } $this->callback_success = $ret; $this->save(); } }
public function processInput($data) { $custom = isset($data['custom']) ? rawurldecode($data['custom']) : null; $data = Kwf_Util_PayPal_Ipn_LogModel::decodeCallback($custom); if ($data) { $order = Kwf_Model_Abstract::getInstance(Kwc_Abstract::getSetting($this->getData()->parent->parent->parent->componentClass, 'childModel'))->getReferencedModel('Order')->getRow($data['data']['orderId']); if ($order->status == 'processing' || $order->status == 'cart') { $order->payment_component_id = $this->getData()->parent->componentId; $order->checkout_component_id = $this->getData()->parent->parent->componentId; $order->cart_component_class = $this->getData()->parent->parent->parent->componentClass; $order->date = date('Y-m-d H:i:s'); $order->status = 'ordered'; $order->save(); } Kwc_Shop_Cart_Orders::setOverriddenCartOrderId($order->id); if (Kwc_Shop_Cart_Orders::getCartOrderId() == $order->id) { Kwc_Shop_Cart_Orders::resetCartOrderId(); } } }