You are here

class CheckoutOrderRequestEvent in Commerce PayPal 8

Defines the Checkout order request event.

Hierarchy

Expanded class hierarchy of CheckoutOrderRequestEvent

See also

\Drupal\commerce_paypal\Event\CommercePaypalEvents

1 file declares its use of CheckoutOrderRequestEvent
CheckoutSdk.php in src/CheckoutSdk.php

File

src/Event/CheckoutOrderRequestEvent.php, line 13

Namespace

Drupal\commerce_paypal\Event
View source
class CheckoutOrderRequestEvent extends Event {

  /**
   * The order.
   *
   * @var \Drupal\commerce_order\Entity\OrderInterface
   */
  protected $order;

  /**
   * The API request body.
   *
   * @var array
   */
  protected $requestBody;

  /**
   * Constructs a new CheckoutOrderRequestEvent object.
   *
   * @param \Drupal\commerce_order\Entity\OrderInterface $order
   *   The order.
   * @param array $request_body
   *   The API request body.
   */
  public function __construct(OrderInterface $order, array $request_body) {
    $this->order = $order;
    $this->requestBody = $request_body;
  }

  /**
   * Gets the order.
   *
   * @return \Drupal\commerce_order\Entity\OrderInterface
   *   The order.
   */
  public function getOrder() {
    return $this->order;
  }

  /**
   * Gets the API request body.
   *
   * @return array
   *   The API request body.
   */
  public function getRequestBody() {
    return $this->requestBody;
  }

  /**
   * Sets the API request body.
   *
   * @param array $request_body
   *   The API request body.
   *
   * @return $this
   */
  public function setRequestBody(array $request_body) {
    $this->requestBody = $request_body;
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CheckoutOrderRequestEvent::$order protected property The order.
CheckoutOrderRequestEvent::$requestBody protected property The API request body.
CheckoutOrderRequestEvent::getOrder public function Gets the order.
CheckoutOrderRequestEvent::getRequestBody public function Gets the API request body.
CheckoutOrderRequestEvent::setRequestBody public function Sets the API request body.
CheckoutOrderRequestEvent::__construct public function Constructs a new CheckoutOrderRequestEvent object.