![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/cartforge.co/app/code/StripeIntegration/Payments/Observer/ |
<?php namespace StripeIntegration\Payments\Observer; use Magento\Payment\Observer\AbstractDataAssignObserver; class OrderObserver extends AbstractDataAssignObserver { private $helper; private $sessionManager; public function __construct( \StripeIntegration\Payments\Helper\Generic $helper, \Magento\Framework\Session\SessionManagerInterface $sessionManager ) { $this->helper = $helper; $this->sessionManager = $sessionManager; } /** * @return void */ public function execute(\Magento\Framework\Event\Observer $observer) { // When a guest customer order is placed in the admin area, clear the session saved variables so that new ones are created in the next session if ($this->helper->isAdmin()) $this->sessionManager->setStripeCustomerId(null); } }