-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from signifyd/4.3.4
4.3.4
- Loading branch information
Showing
23 changed files
with
868 additions
and
331 deletions.
There are no files selected for viewing
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,48 @@ | ||
<?php | ||
/** | ||
* Copyright © All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Signifyd\Connect\Controller\Adminhtml\MarkAsFixed; | ||
|
||
use Magento\Framework\App\Config\Storage\WriterInterface; | ||
use Magento\Backend\App\Action\Context; | ||
|
||
class Index extends \Magento\Backend\App\Action | ||
{ | ||
/** | ||
* @var Context | ||
*/ | ||
protected $context; | ||
|
||
/** | ||
* @var WriterInterface | ||
*/ | ||
protected $configWriter; | ||
|
||
/** | ||
* UpgradeSchema constructor. | ||
* @param WriterInterface $configWriter | ||
* @param Context $context | ||
*/ | ||
public function __construct( | ||
Context $context, | ||
WriterInterface $configWriter | ||
) { | ||
parent::__construct($context); | ||
$this->configWriter = $configWriter; | ||
} | ||
|
||
public function execute() | ||
{ | ||
$this->configWriter->delete("signifyd/general/upgrade4.3_inconsistency"); | ||
|
||
$this->messageManager->addSuccessMessage(__('Successfully marked as fixed')); | ||
$this->messageManager->addWarningMessage(__( | ||
"If the inconsistency message is still visible, it's necessary to clear the config cache" | ||
)); | ||
return $this->_redirect($this->_redirect->getRefererUrl()); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright 2016 SIGNIFYD Inc. All rights reserved. | ||
* See LICENSE.txt for license details. | ||
*/ | ||
|
||
namespace Signifyd\Connect\Cron; | ||
|
||
use Signifyd\Connect\Model\ResourceModel\Casedata\CollectionFactory as CasedataCollectionFactory; | ||
use Magento\Framework\App\Config\Storage\WriterInterface; | ||
use Magento\Framework\App\Config\ScopeConfigInterface; | ||
|
||
class ValidateOrderId | ||
{ | ||
/** | ||
* @var CasedataCollectionFactory | ||
*/ | ||
protected $casedataCollection; | ||
|
||
/** | ||
* @var WriterInterface | ||
*/ | ||
protected $writerInterface; | ||
|
||
/** | ||
* @var ScopeConfigInterface | ||
*/ | ||
protected $scopeConfigInterface; | ||
|
||
/** | ||
* @param CasedataCollectionFactory $casedataCollection | ||
* @param WriterInterface $writerInterface | ||
* @param ScopeConfigInterface $scopeConfigInterface | ||
*/ | ||
public function __construct( | ||
CasedataCollectionFactory $casedataCollection, | ||
WriterInterface $writerInterface, | ||
ScopeConfigInterface $scopeConfigInterface | ||
) { | ||
$this->casedataCollection = $casedataCollection; | ||
$this->writerInterface = $writerInterface; | ||
$this->scopeConfigInterface = $scopeConfigInterface; | ||
} | ||
|
||
public function execute() | ||
{ | ||
$upgradeInconsistency = $this->scopeConfigInterface->getValue("signifyd/general/upgrade4.3_inconsistency"); | ||
|
||
if (isset($upgradeInconsistency)) { | ||
return; | ||
} | ||
|
||
/** @var \Signifyd\Connect\Model\ResourceModel\Casedata\Collection $casedataCollection */ | ||
$casedataCollection = $this->casedataCollection->create(); | ||
$casedataCollection->addFieldToFilter('order_id', ['null' => true]); | ||
|
||
if ($casedataCollection->count() > 0) { | ||
$this->writerInterface->save("signifyd/general/upgrade4.3_inconsistency", "cron"); | ||
} else { | ||
$this->writerInterface->save("signifyd/general/upgrade4.3_inconsistency", "fixed"); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.