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-braintree
Gateway
Response
ThreeDSecureDetailsHandler.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Braintree\Gateway\Response
;
7
8
use Braintree\Transaction;
9
use
Magento\Payment\Gateway\Helper\ContextHelper
;
10
use
Magento\Braintree\Gateway\SubjectReader
;
11
use
Magento\Payment\Gateway\Response\HandlerInterface
;
12
use
Magento\Sales\Api\Data\OrderPaymentInterface
;
13
17
class
ThreeDSecureDetailsHandler
implements
HandlerInterface
18
{
19
const
LIABILITY_SHIFTED
=
'liabilityShifted'
;
20
21
const
LIABILITY_SHIFT_POSSIBLE
=
'liabilityShiftPossible'
;
22
26
private
$subjectReader;
27
33
public
function
__construct
(
SubjectReader
$subjectReader)
34
{
35
$this->subjectReader = $subjectReader;
36
}
37
41
public
function
handle
(array $handlingSubject, array
$response
)
42
{
43
$paymentDO = $this->subjectReader->readPayment($handlingSubject);
48
$payment
= $paymentDO->getPayment();
49
ContextHelper::assertOrderPayment
(
$payment
);
50
52
$transaction
= $this->subjectReader->readTransaction(
$response
);
53
54
if
(
$payment
->hasAdditionalInformation(self::LIABILITY_SHIFTED)) {
55
// remove 3d secure details for reorder
56
$payment
->unsAdditionalInformation(self::LIABILITY_SHIFTED);
57
$payment
->unsAdditionalInformation(self::LIABILITY_SHIFT_POSSIBLE);
58
}
59
60
if
(empty(
$transaction
->threeDSecureInfo)) {
61
return
;
62
}
63
65
$info
=
$transaction
->threeDSecureInfo;
66
$payment
->setAdditionalInformation(self::LIABILITY_SHIFTED,
$info
->liabilityShifted ?
'Yes'
:
'No'
);
67
$shiftPossible =
$info
->liabilityShiftPossible ?
'Yes'
:
'No'
;
68
$payment
->setAdditionalInformation(self::LIABILITY_SHIFT_POSSIBLE, $shiftPossible);
69
}
70
}
$transaction
$transaction
Definition:
partial_invoice.php:43
$response
$response
Definition:
404.php:11
Magento\Sales\Api\Data\OrderPaymentInterface
Definition:
OrderPaymentInterface.php:17
Magento\Braintree\Gateway\Response\ThreeDSecureDetailsHandler\LIABILITY_SHIFTED
const LIABILITY_SHIFTED
Definition:
ThreeDSecureDetailsHandler.php:19
Magento\Braintree\Gateway\Response
Definition:
CancelDetailsHandler.php:8
Magento\Payment\Gateway\Response\HandlerInterface\handle
handle(array $handlingSubject, array $response)
Magento\Braintree\Gateway\Response\ThreeDSecureDetailsHandler
Definition:
ThreeDSecureDetailsHandler.php:17
$payment
$payment
Definition:
order.php:17
Magento\Payment\Gateway\Helper\ContextHelper
Definition:
ContextHelper.php:17
Magento\Payment\Gateway\Response\HandlerInterface
Definition:
HandlerInterface.php:14
Magento\Braintree\Gateway\Response\ThreeDSecureDetailsHandler\__construct
__construct(SubjectReader $subjectReader)
Definition:
ThreeDSecureDetailsHandler.php:33
Magento\Braintree\Gateway\Response\ThreeDSecureDetailsHandler\LIABILITY_SHIFT_POSSIBLE
const LIABILITY_SHIFT_POSSIBLE
Definition:
ThreeDSecureDetailsHandler.php:21
$info
foreach( $_productCollection as $_product)() ?>" class $info
Definition:
listing.phtml:52
Magento\Braintree\Gateway\SubjectReader
Definition:
SubjectReader.php:16
Magento\Payment\Gateway\Helper\ContextHelper\assertOrderPayment
static assertOrderPayment(InfoInterface $paymentInfo)
Definition:
ContextHelper.php:26