You are here

class ExpressCheckoutRequestEvent in Commerce PayPal 8

Defines the Express Checkout request event.

Hierarchy

Expanded class hierarchy of ExpressCheckoutRequestEvent

See also

\Drupal\commerce_paypal\Event\CommercePaypalEvents

2 files declare their use of ExpressCheckoutRequestEvent
ExpressCheckout.php in src/Plugin/Commerce/PaymentGateway/ExpressCheckout.php
ExpressCheckoutRequestSubscriber.php in tests/modules/commerce_paypal_test/src/EventSubscriber/ExpressCheckoutRequestSubscriber.php

File

src/Event/ExpressCheckoutRequestEvent.php, line 13

Namespace

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

  /**
   * The NVP API data array.
   *
   * @var array
   */
  protected $nvpData;

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

  /**
   * Constructs a new ExpressCheckoutRequestEvent object.
   *
   * @param array $nvp_data
   *   The NVP API data array as documented.
   * @param \Drupal\commerce_order\Entity\OrderInterface $order
   *   The order entity, or null.
   */
  public function __construct(array $nvp_data, OrderInterface $order = NULL) {
    $this->nvpData = $nvp_data;
    $this->order = $order;
  }

  /**
   * Gets the order.
   *
   * @return \Drupal\commerce_order\Entity\OrderInterface|null
   *   The order, or NULL if unknown.
   */
  public function getOrder() {
    return $this->order;
  }

  /**
   * Gets the NVP API data array.
   *
   * @return array
   *   The NVP API data array.
   */
  public function getNvpData() {
    return $this->nvpData;
  }

  /**
   * Sets the NVP API data array.
   *
   * @param array $nvp_data
   *   The NVP API data array as documented.
   *
   * @return $this
   */
  public function setNvpData(array $nvp_data) {
    $this->nvpData = $nvp_data;
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ExpressCheckoutRequestEvent::$nvpData protected property The NVP API data array.
ExpressCheckoutRequestEvent::$order protected property The order.
ExpressCheckoutRequestEvent::getNvpData public function Gets the NVP API data array.
ExpressCheckoutRequestEvent::getOrder public function Gets the order.
ExpressCheckoutRequestEvent::setNvpData public function Sets the NVP API data array.
ExpressCheckoutRequestEvent::__construct public function Constructs a new ExpressCheckoutRequestEvent object.