<commit_before><?php
class Vpc_Shop_Cart_Checkout_Payment_Abstract_Component extends Vpc_Abstract_Composite_Component
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['viewCache'] = false;

        $ret['generators']['child']['component']['orderHeader'] = 'Vpc_Shop_Cart_Checkout_Payment_Abstract_OrderHeader_Component';
        $ret['generators']['child']['component']['orderTable'] = 'Vpc_Shop_Cart_Checkout_Payment_Abstract_OrderTable_Component';
        $ret['generators']['child']['component']['confirmLink'] = 'Vpc_Shop_Cart_Checkout_Payment_Abstract_ConfirmLink_Component';

        $ret['generators']['confirm'] = array(
            'class' => 'Vps_Component_Generator_Page_Static',
            'component' => 'Vpc_Shop_Cart_Checkout_Payment_Abstract_Confirm_Component',
            'name' => trlVps('Send order')
        );

        $ret['generators']['mail'] = array(
            'class' => 'Vps_Component_Generator_Static',
            'component' => 'Vpc_Shop_Cart_Checkout_Payment_Abstract_Mail_Component',
        );
        $ret['generators']['shippedMail'] = array(
            'class' => 'Vps_Component_Generator_Static',
            'component' => 'Vpc_Shop_Cart_Checkout_Payment_Abstract_ShippedMail_Component',
        );

        $ret['orderData'] = 'Vpc_Shop_Cart_Checkout_Payment_Abstract_OrderData';

        return $ret;
    }

    public function getTemplateVars()
    {
        $ret = parent::getTemplateVars();
        $ret['order'] = $this->_getOrder();
        $ret['orderProducts'] = $ret['order']->getChildRows('Products');
        $ret['sumRows'] = $this->_getSumRows($this->_getOrder());
        $ret['paymentTypeText'] = $this->_getSetting('componentName');
        return $ret;
    }

    protected function _getOrder()
    {
        return Vps_Model_Abstract::getInstance('Vpc_Shop_Cart_Orders')
                            ->getCartOrder();
    }

    //kann überschrieben werden um zeilen pro payment zu ändern
    protected function _getSumRows($order)
    {
        return $this->getData()->parent->getComponent()->getSumRows($order);
    }

    public final function getAdditionalSumRows() {
        throw new Vps_Exception("removed");
    }
    public final function getAdditionalSum($order) {
        throw new Vps_Exception("removed");
    }

    public function sendConfirmMail($order)
    {
        $mail = $this->getData()->getChildComponent('-mail')->getComponent();
        $data = array(
            'order' => $order,
            'sumRows' => $this->getData()->parent->getComponent()->getSumRows($order)
        );
        $mail->send($order, $data);
    }

    //diese fkt wird bei paypal nicht verwendet!
    //wenn also da was hinzugefuegt wird muss das bei paypal auch gemacht werden
    public function confirmOrder($order)
    {
        $order->payment_component_id = $this->getData()->componentId;
        $order->checkout_component_id = $this->getData()->parent->componentId;
        $order->cart_component_class = $this->getData()->parent->parent->componentClass;
        $order->status = 'ordered';
        $order->date = date('Y-m-d H:i:s');
//         $order->save();

        foreach ($this->getData()->parent->parent->getComponent()->getShopCartPlugins() as $p) {
            $p->orderConfirmed($order);
        }<commit_msg>- auskommentieren vergessen ^^<commit_after><?php
class Vpc_Shop_Cart_Checkout_Payment_Abstract_Component extends Vpc_Abstract_Composite_Component
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['viewCache'] = false;

        $ret['generators']['child']['component']['orderHeader'] = 'Vpc_Shop_Cart_Checkout_Payment_Abstract_OrderHeader_Component';
        $ret['generators']['child']['component']['orderTable'] = 'Vpc_Shop_Cart_Checkout_Payment_Abstract_OrderTable_Component';
        $ret['generators']['child']['component']['confirmLink'] = 'Vpc_Shop_Cart_Checkout_Payment_Abstract_ConfirmLink_Component';

        $ret['generators']['confirm'] = array(
            'class' => 'Vps_Component_Generator_Page_Static',
            'component' => 'Vpc_Shop_Cart_Checkout_Payment_Abstract_Confirm_Component',
            'name' => trlVps('Send order')
        );

        $ret['generators']['mail'] = array(
            'class' => 'Vps_Component_Generator_Static',
            'component' => 'Vpc_Shop_Cart_Checkout_Payment_Abstract_Mail_Component',
        );
        $ret['generators']['shippedMail'] = array(
            'class' => 'Vps_Component_Generator_Static',
            'component' => 'Vpc_Shop_Cart_Checkout_Payment_Abstract_ShippedMail_Component',
        );

        $ret['orderData'] = 'Vpc_Shop_Cart_Checkout_Payment_Abstract_OrderData';

        return $ret;
    }

    public function getTemplateVars()
    {
        $ret = parent::getTemplateVars();
        $ret['order'] = $this->_getOrder();
        $ret['orderProducts'] = $ret['order']->getChildRows('Products');
        $ret['sumRows'] = $this->_getSumRows($this->_getOrder());
        $ret['paymentTypeText'] = $this->_getSetting('componentName');
        return $ret;
    }

    protected function _getOrder()
    {
        return Vps_Model_Abstract::getInstance('Vpc_Shop_Cart_Orders')
                            ->getCartOrder();
    }

    //kann überschrieben werden um zeilen pro payment zu ändern
    protected function _getSumRows($order)
    {
        return $this->getData()->parent->getComponent()->getSumRows($order);
    }

    public final function getAdditionalSumRows() {
        throw new Vps_Exception("removed");
    }
    public final function getAdditionalSum($order) {
        throw new Vps_Exception("removed");
    }

    public function sendConfirmMail($order)
    {
        $mail = $this->getData()->getChildComponent('-mail')->getComponent();
        $data = array(
            'order' => $order,
            'sumRows' => $this->getData()->parent->getComponent()->getSumRows($order)
        );
        $mail->send($order, $data);
    }

    //diese fkt wird bei paypal nicht verwendet!
    //wenn also da was hinzugefuegt wird muss das bei paypal auch gemacht werden
    public function confirmOrder($order)
    {
        $order->payment_component_id = $this->getData()->componentId;
        $order->checkout_component_id = $this->getData()->parent->componentId;
        $order->cart_component_class = $this->getData()->parent->parent->componentClass;
        $order->status = 'ordered';
        $order->date = date('Y-m-d H:i:s');
        $order->save();

        foreach ($this->getData()->parent->parent->getComponent()->getShopCartPlugins() as $p) {
            $p->orderConfirmed($order);
        }
{'fraction_non_alphanumeric': 0.14676022693341295, 'fraction_numerical': 0.0, 'mean_word_length': 3.2668789808917196, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 99, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '931150', 'n_tokens_mistral': 1933, 'n_tokens_neox': 1922, 'n_words': 295}