custom/plugins/StripeShopwarePayment/src/Payment/Subscriber/LogoutSubscriber.php line 35

Open in your IDE?
  1. <?php
  2. /*
  3.  * Copyright (c) Pickware GmbH. All rights reserved.
  4.  * This file is part of software that is released under a proprietary license.
  5.  * You must not copy, modify, distribute, make publicly available, or execute
  6.  * its contents or parts thereof without express permission by the copyright
  7.  * holder, unless otherwise permitted by law.
  8.  */
  9. declare(strict_types=1);
  10. namespace Stripe\ShopwarePayment\Payment\Subscriber;
  11. use Shopware\Core\Checkout\Customer\Event\CustomerLogoutEvent;
  12. use Stripe\ShopwarePayment\Session\StripePaymentMethodSettings;
  13. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  14. class LogoutSubscriber implements EventSubscriberInterface
  15. {
  16.     private StripePaymentMethodSettings $stripePaymentMethodSettings;
  17.     public function __construct(
  18.         StripePaymentMethodSettings $stripePaymentMethodSettings
  19.     ) {
  20.         $this->stripePaymentMethodSettings $stripePaymentMethodSettings;
  21.     }
  22.     public static function getSubscribedEvents(): array
  23.     {
  24.         return [
  25.             CustomerLogoutEvent::class => 'onCustomerLogout',
  26.         ];
  27.     }
  28.     public function onCustomerLogout(): void
  29.     {
  30.         $this->stripePaymentMethodSettings->reset();
  31.     }
  32. }