public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

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

        if (!isset($model[Constants::FIELD_STATUS])) {
            return;
        }

        $cancellableStates = [Constants::STATUS_CAPTURED, Constants::STATUS_AUTHORIZED];

        if (in_array($model[Constants::FIELD_STATUS], $cancellableStates, true)) {
            $model[Constants::FIELD_STATUS] = Constants::STATUS_CANCELED;
        }
    }
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

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

        if (!isset($model[Constants::FIELD_STATUS])) {
            return;
        }

        $cancellableStates = [Constants::STATUS_CAPTURED, Constants::STATUS_AUTHORIZED];

        if (in_array($model[Constants::FIELD_STATUS], $cancellableStates, true)) {
            $model[Constants::FIELD_STATUS] = Constants::STATUS_CANCELED;
        }
    }
{@inheritDoc}

@param Cancel $request