Skip to content

Commit

Permalink
fix: adding pagarmeConfig property
Browse files Browse the repository at this point in the history
  • Loading branch information
mateus-picoloto authored Aug 31, 2023
1 parent f957a24 commit a40a05a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Observer/PaymentMethodAvailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -22,13 +23,19 @@ class PaymentMethodAvailable implements ObserverInterface
*/
protected $recurrenceProductHelper;

/**
* @var Configuration
*/
protected $pagarmeConfig;

public function __construct(
RecurrenceProductHelper $recurrenceProductHelper,
PagarmeConfigProvider $pagarmeConfigProvider
) {
Magento2CoreSetup::bootstrap();
$this->recurrenceProductHelper = $recurrenceProductHelper;
$this->pagarmeConfigProvider = $pagarmeConfigProvider;
$this->pagarmeConfig = Magento2CoreSetup::getModuleConfiguration();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Plugin/Cart/CartConflict.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ protected function buildCurrentProduct(

$repetitionSelected = $this->getOptionRecurrenceSelected(
$productInfo->getOptions(),
$requestInfo['options']
$requestInfo['options'] ?? []
);

$hasNotRepetitionSelected = !$repetitionSelected && !$isNormalProduct;
Expand Down

0 comments on commit a40a05a

Please sign in to comment.