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

        /** @var Payment $model */
        $model = $request->getModel();

        if (isset($model->state) && 'approved' == $model->state) {
            $request->markCaptured();

            return;
        }

        if (isset($model->state) && 'created' == $model->state) {
            $request->markNew();

            return;
        }

        if (false == isset($model->state)) {
            $request->markNew();

            return;
        }

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

        /** @var Payment $model */
        $model = $request->getModel();

        if (isset($model->state) && 'approved' == $model->state) {
            $request->markCaptured();

            return;
        }

        if (isset($model->state) && 'created' == $model->state) {
            $request->markNew();

            return;
        }

        if (false == isset($model->state)) {
            $request->markNew();

            return;
        }

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

@var GetStatusInterface $request