diff --git a/Observer/PaymentMethodAvailable.php b/Observer/PaymentMethodAvailable.php index 7addf730..a4bd73e3 100644 --- a/Observer/PaymentMethodAvailable.php +++ b/Observer/PaymentMethodAvailable.php @@ -4,6 +4,7 @@ use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; +use Pagarme\Core\Kernel\Aggregates\Configuration; use Pagarme\Core\Recurrence\Aggregates\Plan; use Pagarme\Core\Recurrence\Services\RecurrenceService; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; @@ -22,6 +23,11 @@ class PaymentMethodAvailable implements ObserverInterface */ protected $recurrenceProductHelper; + /** + * @var Configuration + */ + protected $pagarmeConfig; + public function __construct( RecurrenceProductHelper $recurrenceProductHelper, PagarmeConfigProvider $pagarmeConfigProvider @@ -29,6 +35,7 @@ public function __construct( Magento2CoreSetup::bootstrap(); $this->recurrenceProductHelper = $recurrenceProductHelper; $this->pagarmeConfigProvider = $pagarmeConfigProvider; + $this->pagarmeConfig = Magento2CoreSetup::getModuleConfiguration(); } /** diff --git a/Plugin/Cart/CartConflict.php b/Plugin/Cart/CartConflict.php index 91ffc05d..0094549c 100644 --- a/Plugin/Cart/CartConflict.php +++ b/Plugin/Cart/CartConflict.php @@ -179,7 +179,7 @@ protected function buildCurrentProduct( $repetitionSelected = $this->getOptionRecurrenceSelected( $productInfo->getOptions(), - $requestInfo['options'] + $requestInfo['options'] ?? [] ); $hasNotRepetitionSelected = !$repetitionSelected && !$isNormalProduct;