Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-signifyd
Plugin
PaymentPlugin.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Signifyd\Plugin
;
7
8
use
Magento\Payment\Model\InfoInterface
;
9
use
Magento\Payment\Model\MethodInterface
;
10
use
Magento\Signifyd\Api\GuaranteeCancelingServiceInterface
;
11
17
class
PaymentPlugin
18
{
22
private
$guaranteeCancelingService;
23
27
public
function
__construct
(
28
GuaranteeCancelingServiceInterface
$guaranteeCancelingService
29
) {
30
$this->guaranteeCancelingService = $guaranteeCancelingService;
31
}
32
44
public
function
afterDenyPayment
(
MethodInterface
$subject,
$result
,
InfoInterface
$payment
)
45
{
46
if
($this->isPaymentDenied(
$payment
,
$result
)) {
47
$this->guaranteeCancelingService->cancelForOrder(
$payment
->getParentId());
48
}
49
50
return
$result
;
51
}
52
63
private
function
isPaymentDenied(
$payment
,
$result
)
64
{
65
return
$result
!==
false
||
$payment
->getIsTransactionClosed();
66
}
67
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Signifyd\Plugin
Definition:
CancelOrderTest.php:6
Magento\Signifyd\Api\GuaranteeCancelingServiceInterface
Definition:
GuaranteeCancelingServiceInterface.php:17
$payment
$payment
Definition:
order.php:17
Magento\Signifyd\Plugin\PaymentPlugin\__construct
__construct(GuaranteeCancelingServiceInterface $guaranteeCancelingService)
Definition:
PaymentPlugin.php:27
Magento\Signifyd\Plugin\PaymentPlugin
Definition:
PaymentPlugin.php:17
Magento\Payment\Model\MethodInterface
Definition:
MethodInterface.php:16
Magento\Signifyd\Plugin\PaymentPlugin\afterDenyPayment
afterDenyPayment(MethodInterface $subject, $result, InfoInterface $payment)
Definition:
PaymentPlugin.php:44
Magento\Payment\Model\InfoInterface
Definition:
InfoInterface.php:14