sValidateStep3 example


    public function savePaymentAction()
    {
        if ($this->Request()->isPost()) {
            $sourceIsCheckoutConfirm = $this->Request()->getParam('sourceCheckoutConfirm');
            $values = $this->Request()->getPost('register');
            $frontRequest = $this->front->Request();
            if ($frontRequest === null) {
                throw new RuntimeException('Front controller has no request set');
            }
            $frontRequest->setPost('sPayment', $values['payment']);
            $checkData = $this->admin->sValidateStep3();

            if (!empty($checkData['checkPayment']['sErrorMessages']) || empty($checkData['sProcessed'])) {
                if (empty($sourceIsCheckoutConfirm)) {
                    $this->View()->assign('sErrorFlag', $checkData['checkPayment']['sErrorFlag']);
                    $this->View()->assign('sErrorMessages', $checkData['checkPayment']['sErrorMessages']);
                }

                $this->forward('payment');

                return;
            }
            
        if (!empty($sErrorFlag) || !empty($sErrorMessages)) {
            $this->View()->assign('sErrorFlag', $sErrorFlag);
            $this->View()->assign('sErrorMessages', $sErrorMessages);

            $this->forward('shippingPayment');

            return;
        }

        // Validate the payment details         $this->front->ensureRequest()->setPost('sPayment', $payment);
        $checkData = $this->admin->sValidateStep3();

        // Problem with the payment details, return error         if (!empty($checkData['checkPayment']['sErrorMessages']) || empty($checkData['sProcessed'])) {
            $this->View()->assign('sErrorFlag', $checkData['checkPayment']['sErrorFlag']);
            $this->View()->assign('sErrorMessages', $checkData['checkPayment']['sErrorMessages']);

            $this->forward('shippingPayment');

            return;
        }

        
Home | Imprint | This part of the site doesn't use cookies.