src/Payum/Payex/Action/Api/CreateAgreementAction.php
public function execute($request)
    {
        /** @var $request CreateAgreement */
        RequestNotSupportedException::assertSupports($this, $request);

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

        if ($model['agreementRef']) {
            throw new LogicException('The agreement has already been created.');
        }

        $model->validatedKeysSet(array(
            'merchantRef',
            'description',
            'purchaseOperation',
            'maxAmount',
            'startDate',
            'stopDate',
        ));

        $model->validateNotEmpty(array(
            'maxAmount',
            'merchantRef',
            'description',
        ));

        $result = $this->api->create((array) $model);

        $model->replace($result);
    }
public function execute($request)
    {
        /** @var $request CreateAgreement */
        RequestNotSupportedException::assertSupports($this, $request);

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

        if ($model['agreementRef']) {
            throw new LogicException('The agreement has already been created.');
        }

        $model->validatedKeysSet(array(
            'merchantRef',
            'description',
            'purchaseOperation',
            'maxAmount',
            'startDate',
            'stopDate',
        ));

        $model->validateNotEmpty(array(
            'maxAmount',
            'merchantRef',
            'description',
        ));

        $result = $this->api->create((array) $model);

        $model->replace($result);
    }
{@inheritDoc}