You are here

public function DecoratedOrderPaymentIntentSubscriber::destruct in Commerce Stripe 8

Performs destruct operations.

Overrides OrderPaymentIntentSubscriber::destruct

File

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

Class

DecoratedOrderPaymentIntentSubscriber

Namespace

Drupal\commerce_stripe_test\EventSubscriber

Code

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;
    }
  }
}