You are here

class OperationResult in Payment 8.2

Provides an operation result.

Hierarchy

Expanded class hierarchy of OperationResult

4 files declare their use of OperationResult
OperationResultTest.php in tests/src/Unit/OperationResultTest.php
PaymentMethodBase.php in src/Plugin/Payment/Method/PaymentMethodBase.php
PaymentTestResponse.php in modules/payment_test/src/Plugin/Payment/Method/PaymentTestResponse.php
Unavailable.php in src/Plugin/Payment/Method/Unavailable.php

File

src/OperationResult.php, line 10

Namespace

Drupal\payment
View source
class OperationResult implements OperationResultInterface {

  /**
   * The response.
   *
   * @var \Drupal\payment\Response\ResponseInterface|null
   */
  protected $response;

  /**
   * Creates a new instance.
   *
   * @param \Drupal\payment\Response\ResponseInterface|null $response
   *   A response or NULL if the operation is completed.
   */
  public function __construct(ResponseInterface $response = NULL) {
    $this->response = $response;
  }

  /**
   * {@inheritdoc}
   */
  public function isCompleted() {
    return is_null($this->response);
  }

  /**
   * {@inheritdoc}
   */
  public function getCompletionResponse() {
    return $this->response;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
OperationResult::$response protected property The response.
OperationResult::getCompletionResponse public function Gets the response to complete the operation. Overrides OperationResultInterface::getCompletionResponse
OperationResult::isCompleted public function Gets whether the operation is completed. Overrides OperationResultInterface::isCompleted
OperationResult::__construct public function Creates a new instance.