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

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

        //TODO: It may be not correct for all cases. This does NOT indicate wether the transaction requested was successful, only wether the request was carried out successfully.
        if ($model['errorCode'] && OrderApi::ERRORCODE_OK != $model['errorCode']) {
            $request->markFailed();

            return;
        }

        if (null === $model['transactionStatus']) {
            $request->markNew();

            return;
        }

        if (
            AgreementApi::PURCHASEOPERATION_SALE == $model['purchaseOperation'] &&
            OrderApi::TRANSACTIONSTATUS_SALE == $model['transactionStatus']
        ) {
            $request->markCaptured();

            return;
        }

        if (
            AgreementApi::PURCHASEOPERATION_AUTHORIZATION == $model['purchaseOperation'] &&
            OrderApi::TRANSACTIONSTATUS_AUTHORIZE == $model['transactionStatus']
        ) {
            $request->markCaptured();

            return;
        }

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

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

        //TODO: It may be not correct for all cases. This does NOT indicate wether the transaction requested was successful, only wether the request was carried out successfully.
        if ($model['errorCode'] && OrderApi::ERRORCODE_OK != $model['errorCode']) {
            $request->markFailed();

            return;
        }

        if (null === $model['transactionStatus']) {
            $request->markNew();

            return;
        }

        if (
            AgreementApi::PURCHASEOPERATION_SALE == $model['purchaseOperation'] &&
            OrderApi::TRANSACTIONSTATUS_SALE == $model['transactionStatus']
        ) {
            $request->markCaptured();

            return;
        }

        if (
            AgreementApi::PURCHASEOPERATION_AUTHORIZATION == $model['purchaseOperation'] &&
            OrderApi::TRANSACTIONSTATUS_AUTHORIZE == $model['transactionStatus']
        ) {
            $request->markCaptured();

            return;
        }

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

@param GetStatusInterface $request