Skip to content

Commit

Permalink
Added fix for admin messaging (#141)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrii Onufriichuk <[email protected]>
Co-authored-by: Aashwin Mohan <[email protected]>
  • Loading branch information
3 people authored Jul 1, 2024
1 parent a7b66cc commit 90e3f31
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Controller/Adminhtml/Availability/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Framework\App\Area;
use Magento\Framework\Controller\Result\Json;
use Magento\Framework\Controller\ResultFactory;
use Magento\Store\Model\App\Emulation;
use Magento\Store\Model\ScopeInterface;
use Rvvup\Payments\Model\ConfigInterface;
use Rvvup\Payments\Model\SdkProxy;
Expand All @@ -21,18 +23,24 @@ class Index extends Action implements HttpPostActionInterface
/** @var SdkProxy */
private $sdkProxy;

/** @var Emulation */
private $emulation;

/**
* @param ConfigInterface $config
* @param SdkProxy $sdkProxy
* @param Context $context
* @param Emulation $emulation
*/
public function __construct(
ConfigInterface $config,
SdkProxy $sdkProxy,
Context $context
Context $context,
Emulation $emulation
) {
$this->sdkProxy = $sdkProxy;
$this->config = $config;
$this->emulation = $emulation;
parent::__construct($context);
}
/**
Expand All @@ -46,6 +54,7 @@ public function execute()
$storeId = $this->_request->getParam('store_id');
$currencyCode = $this->_request->getParam('currency_code');
$allowedPaymentLinksMethods = ['YAPILY','CARD','APPLE_PAY'];
$this->emulation->startEnvironmentEmulation($storeId, Area::AREA_ADMINHTML);

$result = $this->resultFactory->create(ResultFactory::TYPE_JSON);

Expand Down

0 comments on commit 90e3f31

Please sign in to comment.