code: 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;
          }
      }
docs: {@inheritDoc}
  
  @param Cancel $request