Skip to content

Commit 44113c4

Browse files
committed
Merge remote-tracking branch 'origin/2.2-develop' into MC-18211
2 parents 148c63c + 2e00a7f commit 44113c4

File tree

806 files changed

+8285
-4446
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

806 files changed

+8285
-4446
lines changed

app/code/Magento/Analytics/view/adminhtml/templates/dashboard/section.phtml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
// @codingStandardsIgnoreFile
76
?>
87

98
<section class="dashboard-advanced-reports" data-index="dashboard-advanced-reports">

app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/iframe.phtml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
/**
108
* @var $block \Magento\Authorizenet\Block\Transparent\Iframe
119
*/
@@ -15,15 +13,15 @@ $helper = $block->getHelper('adminhtml');
1513
<html>
1614
<head>
1715
<script>
18-
<?php if (isset($params['redirect'])): ?>
16+
<?php if (isset($params['redirect'])) : ?>
1917
window.location="<?= $block->escapeUrl($params['redirect']) ?>";
2018
<?php endif; ?>
21-
<?php if (isset($params['redirect_parent'])): ?>
19+
<?php if (isset($params['redirect_parent'])) : ?>
2220
window.top.location="<?= $block->escapeUrl($params['redirect_parent']) ?>";
2321
<?php endif; ?>
24-
<?php if (isset($params['error_msg'])): ?>
22+
<?php if (isset($params['error_msg'])) : ?>
2523
window.top.directPostModel.showError(<?= /* @noEscape */ json_encode((array)$params['error_msg']) ?>);
26-
<?php if (isset($params['x_invoice_num'])): ?>
24+
<?php if (isset($params['x_invoice_num'])) : ?>
2725
window.top.directPostModel.successUrl="<?= $block->escapeUrl($helper->getSuccessOrderUrl($params)) ?>";
2826
<?php endif; ?>
2927
<?php endif; ?>

app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/info.phtml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
87
/**
98
* @var \Magento\Authorizenet\Block\Transparent\Iframe $block
109
* @see \Magento\Authorizenet\Block\Transparent\Iframe
1110
*/
1211
$code = $block->escapeHtml($block->getMethodCode());
1312
$method = $block->getMethod();
1413
$controller = $block->escapeHtml($block->getRequest()->getControllerName());
15-
$orderUrl = $block->escapeUrl($this->helper('Magento\Authorizenet\Helper\Backend\Data')->getPlaceOrderAdminUrl());
14+
$orderUrl = $block->escapeUrl($block->getHelper('adminhtml')->getPlaceOrderAdminUrl());
1615
$ccType = $block->getInfoData('cc_type');
1716
$ccExpMonth = $block->getInfoData('cc_exp_month');
1817
$ccExpYear = $block->getInfoData('cc_exp_year');
@@ -41,9 +40,9 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
4140
'validate-cc-type-select':'#<?= /* @noEscape */ $code ?>_cc_number'
4241
}">
4342
<option value=""><?= $block->escapeHtml(__('Please Select')) ?></option>
44-
<?php foreach ($block->getCcAvailableTypes() as $typeCode => $typeName): ?>
43+
<?php foreach ($block->getCcAvailableTypes() as $typeCode => $typeName) : ?>
4544
<option value="<?= $block->escapeHtml($typeCode) ?>"
46-
<?php if ($typeCode == $ccType): ?>selected="selected"<?php endif; ?>>
45+
<?php if ($typeCode == $ccType) : ?>selected="selected"<?php endif; ?>>
4746
<?= $block->escapeHtml($typeName) ?>
4847
</option>
4948
<?php endforeach; ?>
@@ -81,9 +80,9 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
8180
'required':true,
8281
'validate-cc-exp':'#<?= /* @noEscape */ $code ?>_expiration_yr'
8382
}">
84-
<?php foreach ($block->getCcMonths() as $k => $v): ?>
83+
<?php foreach ($block->getCcMonths() as $k => $v) : ?>
8584
<option value="<?= $block->escapeHtml($k) ?>"
86-
<?php if ($k == $ccExpMonth): ?>selected="selected"<?php endif; ?>>
85+
<?php if ($k == $ccExpMonth) : ?>selected="selected"<?php endif; ?>>
8786
<?= $block->escapeHtml($v) ?>
8887
</option>
8988
<?php endforeach; ?>
@@ -93,17 +92,17 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
9392
class="admin__control-select admin__control-select-year"
9493
data-container="<?= /* @noEscape */ $code ?>-cc-year"
9594
data-validate="{required:true}">
96-
<?php foreach ($block->getCcYears() as $k => $v): ?>
95+
<?php foreach ($block->getCcYears() as $k => $v) : ?>
9796
<option value="<?= /* @noEscape */ $k ? $block->escapeHtml($k) : '' ?>"
98-
<?php if ($k == $ccExpYear): ?>selected="selected"<?php endif; ?>>
97+
<?php if ($k == $ccExpYear) : ?>selected="selected"<?php endif; ?>>
9998
<?= $block->escapeHtml($v) ?>
10099
</option>
101100
<?php endforeach; ?>
102101
</select>
103102
</div>
104103
</div>
105104

106-
<?php if ($block->hasVerification()): ?>
105+
<?php if ($block->hasVerification()) : ?>
107106
<div class="admin__field _required field-cvv">
108107
<label class="admin__field-label"
109108
for="<?= /* @noEscape */ $code ?>_cc_cid"

app/code/Magento/Authorizenet/view/adminhtml/templates/order/view/info/fraud_details.phtml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,48 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
87
/**
98
* @var \Magento\Authorizenet\Block\Adminhtml\Order\View\Info\FraudDetails $block
109
*/
1110
$payment = $block->getPayment();
1211
$fraudDetails = $payment->getAdditionalInformation('fraud_details');
1312
?>
1413

15-
<?php if (!empty($fraudDetails)): ?>
14+
<?php if (!empty($fraudDetails)) : ?>
1615
<div class="admin__page-section-item-title">
1716
<span class="title"><?= $block->escapeHtml(__('Fraud Detection ')) ?></span>
1817
</div>
1918

2019
<div class="admin__page-section-item-content">
2120
<div class="order-payment-additional">
22-
<?php if(!empty($fraudDetails['fds_filter_action'])): ?>
21+
<?php if (!empty($fraudDetails['fds_filter_action'])) : ?>
2322
<?= $block->escapeHtml(__('FDS Filter Action')) ?>:
2423
<?= $block->escapeHtml($fraudDetails['fds_filter_action']) ?>
2524
</br>
2625
<?php endif; ?>
2726

28-
<?php if(!empty($fraudDetails['avs_response'])): ?>
27+
<?php if (!empty($fraudDetails['avs_response'])) : ?>
2928
<?= $block->escapeHtml(__('AVS Response')) ?>:
3029
<?= $block->escapeHtml($fraudDetails['avs_response']) ?>
3130
</br>
3231
<?php endif; ?>
3332

34-
<?php if(!empty($fraudDetails['card_code_response'])): ?>
33+
<?php if (!empty($fraudDetails['card_code_response'])) : ?>
3534
<?= $block->escapeHtml(__('Card Code Response')) ?>:
3635
<?= $block->escapeHtml($fraudDetails['card_code_response']) ?>
3736
</br>
3837
<?php endif; ?>
3938

40-
<?php if(!empty($fraudDetails['cavv_response']) || ($fraudDetails['cavv_response'] === 0)): ?>
39+
<?php if (!empty($fraudDetails['cavv_response']) || ($fraudDetails['cavv_response'] === 0)) : ?>
4140
<?= $block->escapeHtml(__('CAVV Response')) ?>:
4241
<?= $block->escapeHtml($fraudDetails['cavv_response']) ?>
4342
</br>
4443
<?php endif; ?>
4544

46-
<?php if(!empty($fraudDetails['fraud_filters'])): ?>
45+
<?php if (!empty($fraudDetails['fraud_filters'])) : ?>
4746
<strong><?= $block->escapeHtml(__('Fraud Filters')) ?>:
4847
</strong></br>
49-
<?php foreach($fraudDetails['fraud_filters'] as $filter): ?>
48+
<?php foreach ($fraudDetails['fraud_filters'] as $filter) : ?>
5049
<?= $block->escapeHtml($filter['name']) ?>:
5150
<?= $block->escapeHtml($filter['action']) ?>
5251
</br>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\AuthorizenetAcceptjs\Gateway\Request;
10+
11+
use Magento\Payment\Gateway\Request\BuilderInterface;
12+
13+
/**
14+
* Stub data builder.
15+
*
16+
* Since the order of params is matters for Authorize.net request,
17+
* this builder is used to reserve a place in builders sequence.
18+
*/
19+
class StubDataBuilder implements BuilderInterface
20+
{
21+
/**
22+
* @inheritdoc
23+
*/
24+
public function build(array $buildSubject): array
25+
{
26+
return [];
27+
}
28+
}

app/code/Magento/AuthorizenetAcceptjs/Gateway/Response/CloseTransactionHandler.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,19 @@ class CloseTransactionHandler implements HandlerInterface
2222
*/
2323
private $subjectReader;
2424

25+
/**
26+
* @var bool
27+
*/
28+
private $closeTransaction;
29+
2530
/**
2631
* @param SubjectReader $subjectReader
32+
* @param bool $closeTransaction
2733
*/
28-
public function __construct(SubjectReader $subjectReader)
34+
public function __construct(SubjectReader $subjectReader, bool $closeTransaction = true)
2935
{
3036
$this->subjectReader = $subjectReader;
37+
$this->closeTransaction = $closeTransaction;
3138
}
3239

3340
/**
@@ -39,7 +46,7 @@ public function handle(array $handlingSubject, array $response)
3946
$payment = $paymentDO->getPayment();
4047

4148
if ($payment instanceof Payment) {
42-
$payment->setIsTransactionClosed(true);
49+
$payment->setIsTransactionClosed($this->closeTransaction);
4350
$payment->setShouldCloseParentTransaction(true);
4451
}
4552
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\AuthorizenetAcceptjs\Plugin;
7+
8+
use Magento\Framework\View\Asset\Minification;
9+
10+
/**
11+
* Plugin for Magento\Framework\View\Asset\Minification.
12+
*/
13+
class ExcludeFilesFromMinification
14+
{
15+
/**
16+
* Add Accept.js to exclude from minification
17+
*
18+
* @param Minification $subject
19+
* @param array $result
20+
* @param $contentType
21+
*
22+
* @return array
23+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
24+
*/
25+
public function afterGetExcludes(Minification $subject, array $result, $contentType)
26+
{
27+
if ($contentType == 'js') {
28+
$result[] = '/v1/Accept';
29+
}
30+
return $result;
31+
}
32+
}

app/code/Magento/AuthorizenetAcceptjs/etc/adminhtml/di.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,29 @@
1111
<argument name="config" xsi:type="object">Magento\AuthorizenetAcceptjs\Model\Ui\ConfigProvider</argument>
1212
</arguments>
1313
</type>
14+
<virtualType name="AuthorizenetAcceptjsAuthorizeRequest" type="Magento\Payment\Gateway\Request\BuilderComposite">
15+
<arguments>
16+
<argument name="builders" xsi:type="array">
17+
<item name="request_type" xsi:type="string">AuthorizenetAcceptjsTransactionRequestTypeBuilder</item>
18+
<item name="store" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\StoreConfigBuilder</item>
19+
<item name="merchant_account" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\AuthenticationDataBuilder</item>
20+
<item name="transaction_type" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\AuthorizeDataBuilder</item>
21+
<item name="amount" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\AmountDataBuilder</item>
22+
<item name="payment" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\PaymentDataBuilder</item>
23+
<item name="shipping" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\ShippingDataBuilder</item>
24+
<item name="solution" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\SolutionDataBuilder</item>
25+
<item name="order" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\OrderDataBuilder</item>
26+
<item name="po" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\PoDataBuilder</item>
27+
<item name="customer" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\CustomerDataBuilder</item>
28+
<item name="address" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\AddressDataBuilder</item>
29+
<item name="custom_settings" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\CustomSettingsBuilder</item>
30+
<item name="passthrough_data" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\PassthroughDataBuilder</item>
31+
</argument>
32+
</arguments>
33+
</virtualType>
34+
<virtualType name="AuthorizenetAcceptjsAuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
35+
<arguments>
36+
<argument name="validator" xsi:type="object">AuthorizenetAcceptjsTransactionValidator</argument>
37+
</arguments>
38+
</virtualType>
1439
</config>

app/code/Magento/AuthorizenetAcceptjs/etc/di.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
<arguments>
135135
<argument name="requestBuilder" xsi:type="object">AuthorizenetAcceptjsRefundRequest</argument>
136136
<argument name="handler" xsi:type="object">AuthorizenetAcceptjsRefundSettledHandler</argument>
137+
<argument name="validator" xsi:type="object">AuthorizenetAcceptjsTransactionValidator</argument>
137138
</arguments>
138139
</virtualType>
139140
<virtualType name="AuthorizenetAcceptjsCaptureCommand" type="Magento\AuthorizenetAcceptjs\Gateway\Command\CaptureStrategyCommand">
@@ -145,6 +146,7 @@
145146
<arguments>
146147
<argument name="requestBuilder" xsi:type="object">AuthorizenetAcceptjsCaptureRequest</argument>
147148
<argument name="handler" xsi:type="object">AuthorizenetAcceptjsCaptureTransactionHandler</argument>
149+
<argument name="validator" xsi:type="object">AuthorizenetAcceptjsTransactionValidator</argument>
148150
</arguments>
149151
</virtualType>
150152
<virtualType name="AuthorizenetAcceptjsVoidCommand" type="Magento\Payment\Gateway\Command\GatewayCommand">
@@ -188,10 +190,15 @@
188190
</argument>
189191
</arguments>
190192
</virtualType>
193+
<virtualType name="CloseCaptureTransactionHandler" type="Magento\AuthorizenetAcceptjs\Gateway\Response\CloseTransactionHandler">
194+
<arguments>
195+
<argument name="closeTransaction" xsi:type="boolean">false</argument>
196+
</arguments>
197+
</virtualType>
191198
<virtualType name="AuthorizenetAcceptjsCaptureTransactionHandler" type="Magento\Payment\Gateway\Response\HandlerChain">
192199
<arguments>
193200
<argument name="handlers" xsi:type="array">
194-
<item name="close_parent_transaction" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Response\CloseParentTransactionHandler</item>
201+
<item name="close_transaction" xsi:type="string">CloseCaptureTransactionHandler</item>
195202
</argument>
196203
</arguments>
197204
</virtualType>
@@ -258,6 +265,7 @@
258265
<item name="po" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\PoDataBuilder</item>
259266
<item name="customer" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\CustomerDataBuilder</item>
260267
<item name="address" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\AddressDataBuilder</item>
268+
<item name="3d_secure" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\StubDataBuilder</item>
261269
<item name="custom_settings" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\CustomSettingsBuilder</item>
262270
<item name="passthrough_data" xsi:type="string">Magento\AuthorizenetAcceptjs\Gateway\Request\PassthroughDataBuilder</item>
263271
</argument>
@@ -425,4 +433,8 @@
425433
<argument name="config" xsi:type="object">Magento\AuthorizenetAcceptjs\Gateway\Config</argument>
426434
</arguments>
427435
</virtualType>
436+
437+
<type name="Magento\Framework\View\Asset\Minification">
438+
<plugin name="excludeAcceptJsFromMin" type="Magento\AuthorizenetAcceptjs\Plugin\ExcludeFilesFromMinification" />
439+
</type>
428440
</config>

0 commit comments

Comments
 (0)