Your IP : 216.73.217.95


Current Path : /var/www/www.indacotrentino.com/www/vendor/stripe/module-payments/Observer/
Upload File :
Current File : /var/www/www.indacotrentino.com/www/vendor/stripe/module-payments/Observer/AfterRemoveCartItem.php

<?php

namespace StripeIntegration\Payments\Observer;

class AfterRemoveCartItem implements \Magento\Framework\Event\ObserverInterface
{
    private $helper;
    private $subscriptionsHelper;
    private $request;

    public function __construct(
        \StripeIntegration\Payments\Helper\Generic $helper,
        \StripeIntegration\Payments\Helper\Subscriptions $subscriptionsHelper,
        \Magento\Framework\App\Request\Http $request
    )
    {
        $this->helper = $helper;
        $this->subscriptionsHelper = $subscriptionsHelper;
        $this->request = $request;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        try
        {
            if ($this->request->getFullActionName() == 'checkout_cart_updateItemOptions')
                return;

            $this->subscriptionsHelper->cancelSubscriptionUpdate();
        }
        catch (\Exception $e)
        {
            $this->helper->logError($e->getMessage(), $e->getTraceAsString());
        }
    }
}