-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
preliminary completion of auto-setting
- Loading branch information
1 parent
87172c2
commit 5898926
Showing
7 changed files
with
151 additions
and
18 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
Controller/Adminhtml/Configuration/SetUpdateSettingsMessage.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace Airwallex\Payments\Controller\Adminhtml\Configuration; | ||
|
||
use Magento\Framework\Math\Random; | ||
use Magento\Backend\App\Action; | ||
use Magento\Backend\App\Action\Context; | ||
use Magento\Framework\Controller\Result\Json; | ||
use Magento\Framework\Controller\Result\JsonFactory; | ||
use Magento\Framework\Exception\NoSuchEntityException; | ||
use Magento\Store\Model\StoreManager; | ||
use Magento\Framework\App\CacheInterface; | ||
use Magento\Framework\App\RequestInterface; | ||
|
||
class SetUpdateSettingsMessage extends Action | ||
{ | ||
public const CACHE_NAME = 'airwallex_set_update_settings_message'; | ||
|
||
protected JsonFactory $resultJsonFactory; | ||
protected Context $context; | ||
protected StoreManager $storeManager; | ||
protected Random $random; | ||
protected CacheInterface $cache; | ||
protected RequestInterface $request; | ||
|
||
public function __construct( | ||
Context $context, | ||
JsonFactory $resultJsonFactory, | ||
StoreManager $storeManager, | ||
Random $random, | ||
CacheInterface $cache, | ||
RequestInterface $request | ||
) | ||
{ | ||
parent::__construct($context); | ||
$this->resultJsonFactory = $resultJsonFactory; | ||
$this->context = $context; | ||
$this->storeManager = $storeManager; | ||
$this->random = $random; | ||
$this->cache = $cache; | ||
$this->request = $request; | ||
} | ||
|
||
/** | ||
* @return Json | ||
*/ | ||
public function execute(): Json | ||
{ | ||
$resultJson = $this->resultJsonFactory->create(); | ||
$this->context->getMessageManager()->addSuccessMessage('Your Airwallex plug-in is activated. | ||
You can also manage which account is connected to your Magento store.'); | ||
header('Location: ' . base64_decode($this->request->getParam('target_url'))); | ||
return $resultJson; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters