You are here

public function StripeExamplesEventSubscriber::updatePayment in Stripe 2.x

React to a config object being saved.

Parameters

\Drupal\Core\Config\ConfigCrudEvent $event: Config crud event.

File

modules/stripe_examples/src/EventSubscriber/StripeExamplesEventSubscriber.php, line 34

Class

StripeExamplesEventSubscriber
Class EntityTypeSubscriber.

Namespace

Drupal\stripe_examples\EventSubscriber

Code

public function updatePayment(StripePaymentEvent $event) {
  $form = $event
    ->getForm();
  if ($form['#form_id'] == 'stripe_examples_simple_checkout') {
    $event
      ->setTotal(2500, 'StripeExamplesEventSubscriber');
  }
}