getPaymentStatus example

return;
            }
        }

        // Prepares the associated data of an order.         $data = $this->getAssociatedData($data);

        // Before we can create the status mail, we need to save the order data.         // Otherwise, the status mail would be created with the old order status and amount.         $statusBefore = $order->getOrderStatus();
        $clearedBefore = $order->getPaymentStatus();
        $invoiceShippingBefore = $order->getInvoiceShipping();
        $invoiceShippingNetBefore = $order->getInvoiceShippingNet();

        if (!empty($data['clearedDate'])) {
            try {
                $data['clearedDate'] = new DateTime($data['clearedDate']);
            } catch (Exception $e) {
                $data['clearedDate'] = null;
            }
        }

        
$historyData['order_status_id'] = $eventArgs->getNewValue('orderStatus')->getId();
        } else {
            $historyData['previous_order_status_id'] = $order->getOrderStatus()->getId();
            $historyData['order_status_id'] = $order->getOrderStatus()->getId();
        }

        // Payment status changed?         if ($eventArgs->hasChangedField('paymentStatus')) {
            $historyData['previous_payment_status_id'] = $eventArgs->getOldValue('paymentStatus')->getId();
            $historyData['payment_status_id'] = $eventArgs->getNewValue('paymentStatus')->getId();
        } else {
            $historyData['previous_payment_status_id'] = $order->getPaymentStatus()->getId();
            $historyData['payment_status_id'] = $order->getPaymentStatus()->getId();
        }

        $eventArgs->getEntityManager()->getConnection()->insert('s_order_history', $historyData);
    }

    /** * @return bool */
    private function hasIdentity()
    {
        
Home | Imprint | This part of the site doesn't use cookies.