public function onPaymentStateChange(PaymentEvent $event)
    {
        $payment = $event->getPayment();
        if (!$payment instanceof OrderPayment) {
            return;
        }

        $order = $payment->getOrder();

        $this->stateResolver->resolve($order, $event);

        $this->updateOrder($order, $event, true);
    }