-
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.
3.5.0: MAG-505: Fix or Stripe invoice and capture
Stripe extension has a bug to invoice and capture transactions that are not performed on adminhtml area
- Loading branch information
1 parent
fc8df8b
commit 2f3bd88
Showing
4 changed files
with
47 additions
and
2 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,41 @@ | ||
<?php | ||
|
||
namespace Signifyd\Connect\Plugin\StripeIntegration\Payments\Helper; | ||
|
||
use StripeIntegration\Payments\Helper\Generic as ParentGeneric; | ||
use Magento\Framework\App\State; | ||
use Magento\Framework\App\Area; | ||
|
||
class Generic | ||
{ | ||
/** | ||
* @var State | ||
*/ | ||
protected $appState; | ||
|
||
/** | ||
* Generic constructor. | ||
* @param State $appState | ||
*/ | ||
public function __construct(State $appState) | ||
{ | ||
$this->appState = $appState; | ||
} | ||
|
||
/** | ||
* @param ParentGeneric $subject | ||
* @param $return | ||
* @return bool | ||
* @throws \Magento\Framework\Exception\LocalizedException | ||
*/ | ||
public function afterIsAdmin(ParentGeneric $subject, $return) | ||
{ | ||
if ($return === false) { | ||
$areaCode = $this->appState->getAreaCode(); | ||
|
||
$return = in_array($areaCode, [Area::AREA_FRONTEND, Area::AREA_CRONTAB]); | ||
} | ||
|
||
return $return; | ||
} | ||
} |
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