Skip to content

Commit

Permalink
3.5.0: MAG-505: Fix or Stripe invoice and capture
Browse files Browse the repository at this point in the history
Stripe extension has a bug to invoice and capture transactions that
are not performed on adminhtml area
  • Loading branch information
ebanolopes committed Nov 14, 2019
1 parent fc8df8b commit 2f3bd88
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
41 changes: 41 additions & 0 deletions Plugin/StripeIntegration/Payments/Helper/Generic.php
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;
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"php": ">=5.5.22"
},
"type": "magento2-module",
"version": "3.4.4",
"version": "3.5.0",
"autoload": {
"files": [
"registration.php"
Expand Down
4 changes: 4 additions & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,8 @@
<type name="Magento\Sales\Model\Order">
<plugin name="Signifyd_Connect_Magento_Sales_Model_Order" type="\Signifyd\Connect\Plugin\Magento\Sales\Model\Order" />
</type>

<type name="StripeIntegration\Payments\Helper\Generic">
<plugin name="Signifyd_Connect_StripeIntegration_Payments_Helper_Generic" type="\Signifyd\Connect\Plugin\StripeIntegration\Payments\Helper\Generic" />
</type>
</config>
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Signifyd_Connect" setup_version="3.4.4">
<module name="Signifyd_Connect" setup_version="3.5.0">
<sequence>
<module name="Magento_Sales" />
<module name="Magento_Payment" />
Expand Down

0 comments on commit 2f3bd88

Please sign in to comment.