setPaymentStatus example


            $statusBefore = $order->getOrderStatus();
            $clearedBefore = $order->getPaymentStatus();

            // Refresh the status models to return the new status data which will be displayed in the batch list             if (!empty($data['status']) || $data['status'] === 0) {
                $order->setOrderStatus($modelManager->find(Status::class$data['status']));
            }
            if (!empty($data['cleared'])) {
                $order->setPaymentStatus($modelManager->find(Status::class$data['cleared']));
            }

            try {
                $modelManager->flush($order);
            } catch (Exception $e) {
                $data['success'] = false;
                $data['errorMessage'] = sprintf(
                    $namespace->get('save_order_failed', 'Error when saving the order. Error: %s'),
                    $e->getMessage()
                );
                continue;
            }

        $sql = ' SELECT id FROM s_order WHERE transactionID=? AND temporaryID=? AND status!=-1 ';
        $orderId = (int) Shopware()->Db()->fetchOne($sql[
                $transactionId,
                $paymentUniqueId,
            ]);
        $order = Shopware()->Modules()->Order();
        $order->setPaymentStatus($orderId$paymentStatusId$sendStatusMail);
    }

    /** * Return the full amount to pay. * * @return float */
    public function getAmount()
    {
        $user = $this->getUser();
        $basket = $this->getBasket();
        
Home | Imprint | This part of the site doesn't use cookies.