src/Payum/Klarna/Invoice/Action/StatusAction.php
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        $details = ArrayObject::ensureArrayObject($request->getModel());

        if ($details['error_code']) {
            $request->markFailed();

            return;
        }

        if ($details['canceled']) {
            $request->markCanceled();

            return;
        }

        if ($details['refund_invoice_number']) {
            $request->markRefunded();

            return;
        }

        if ($details['invoice_number']) {
            $request->markCaptured();

            return;
        }

        if (false == $details['status']) {
            $request->markNew();

            return;
        }

        if (\KlarnaFlags::ACCEPTED == $details['status']) {
            $request->markAuthorized();

            return;
        }

        if (\KlarnaFlags::PENDING == $details['status']) {
            $request->markPending();

            return;
        }

        if (\KlarnaFlags::DENIED == $details['status']) {
            $request->markFailed();

            return;
        }

        $request->markUnknown();
    }
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        $details = ArrayObject::ensureArrayObject($request->getModel());

        if ($details['error_code']) {
            $request->markFailed();

            return;
        }

        if ($details['canceled']) {
            $request->markCanceled();

            return;
        }

        if ($details['refund_invoice_number']) {
            $request->markRefunded();

            return;
        }

        if ($details['invoice_number']) {
            $request->markCaptured();

            return;
        }

        if (false == $details['status']) {
            $request->markNew();

            return;
        }

        if (\KlarnaFlags::ACCEPTED == $details['status']) {
            $request->markAuthorized();

            return;
        }

        if (\KlarnaFlags::PENDING == $details['status']) {
            $request->markPending();

            return;
        }

        if (\KlarnaFlags::DENIED == $details['status']) {
            $request->markFailed();

            return;
        }

        $request->markUnknown();
    }
{@inheritDoc}

@param GetStatusInterface $request