-
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.
Merge pull request #41 from airwallex/leon-awx
Leon awx
- Loading branch information
Showing
46 changed files
with
2,526 additions
and
407 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
|
||
namespace Airwallex\Payments\Model\Adminhtml\Notifications; | ||
|
||
use Airwallex\Payments\Helper\Configuration; | ||
use Magento\Framework\Notification\MessageInterface; | ||
|
||
class ExpressDisabled implements MessageInterface | ||
{ | ||
/** | ||
* @var string|null | ||
*/ | ||
private ?string $displayedText = null; | ||
|
||
/** | ||
* @var Configuration | ||
*/ | ||
private Configuration $configuration; | ||
|
||
/** | ||
* Dependencies constructor. | ||
* | ||
* @param Configuration $configuration | ||
*/ | ||
public function __construct( | ||
Configuration $configuration | ||
){ | ||
$this->configuration = $configuration; | ||
$this->expressDisabled(); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getIdentity(): string | ||
{ | ||
return 'airwallex_payments_notification_express_disabled'; | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isDisplayed(): bool | ||
{ | ||
return $this->displayedText !== null; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getText(): string | ||
{ | ||
return $this->displayedText; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getSeverity(): int | ||
{ | ||
return self::SEVERITY_NOTICE; | ||
} | ||
|
||
/** | ||
* @return void | ||
*/ | ||
private function expressDisabled(): void { | ||
if (!$this->configuration->isCardActive()) { | ||
$this->displayedText = __('Airwallex Express Checkout is also disabled. To use Express Checkout, you must first enable Credit Card payments.'); | ||
} | ||
} | ||
} |
Oops, something went wrong.