You are here

class DecoratedOrderPaymentIntentSubscriber in Commerce Stripe 8

Hierarchy

Expanded class hierarchy of DecoratedOrderPaymentIntentSubscriber

1 string reference to 'DecoratedOrderPaymentIntentSubscriber'
commerce_stripe_test.services.yml in tests/modules/commerce_stripe_test/commerce_stripe_test.services.yml
tests/modules/commerce_stripe_test/commerce_stripe_test.services.yml
1 service uses DecoratedOrderPaymentIntentSubscriber
commerce_stripe_test.decorated_order_payment_intent_subscriber in tests/modules/commerce_stripe_test/commerce_stripe_test.services.yml
Drupal\commerce_stripe_test\EventSubscriber\DecoratedOrderPaymentIntentSubscriber

File

tests/modules/commerce_stripe_test/src/EventSubscriber/DecoratedOrderPaymentIntentSubscriber.php, line 9

Namespace

Drupal\commerce_stripe_test\EventSubscriber
View source
class DecoratedOrderPaymentIntentSubscriber extends OrderPaymentIntentSubscriber {

  /**
   * {@inheritdoc}
   */
  public function destruct() {
    foreach ($this->updateList as $intent_id => $amount) {
      try {
        PaymentIntent::update($intent_id, [
          'amount' => $amount,
        ]);
      } catch (StripeError $e) {

        // Ensure all API exceptions throw during testing.
        throw $e;
      }
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DecoratedOrderPaymentIntentSubscriber::destruct public function Performs destruct operations. Overrides OrderPaymentIntentSubscriber::destruct
OrderPaymentIntentSubscriber::$entityTypeManager protected property The entity type manager.
OrderPaymentIntentSubscriber::$updateList protected property The intent IDs that need updating.
OrderPaymentIntentSubscriber::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to.
OrderPaymentIntentSubscriber::onOrderUpdate public function Ensures the Stripe payment intent is up to date.
OrderPaymentIntentSubscriber::toMinorUnits protected function Converts the given amount to its minor units.
OrderPaymentIntentSubscriber::__construct public function Constructs a new OrderEventsSubscriber object.