Skip to content

Commit aaa5420

Browse files
author
Stanislav Idolov
committed
Merge remote-tracking branch 'mainline/2.3-develop' into feature-newsletter-config
2 parents 8c7a1c8 + 908a6bb commit aaa5420

File tree

856 files changed

+23720
-4563
lines changed

Some content is hidden

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

856 files changed

+23720
-4563
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ script:
6464

6565
# The scripts for grunt/phpunit type tests
6666
- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
67-
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js"] && [ $TEST_SUITE != "graphql-api-functional" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
67+
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ] && [ $TEST_SUITE != "graphql-api-functional" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
6868
- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi
6969
- if [ $TEST_SUITE == "graphql-api-functional" ]; then phpunit -c dev/tests/api-functional; fi

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ Magento is thankful for any contribution that can improve our code base, documen
3939
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png"/>
4040
</a>
4141

42-
<h3>Labels applied by the Magento team</h3>
43-
We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more.
44-
Please review the <a href="https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#labels">Code Contributions guide</a> for detailed information on labels used in Magento 2 repositories.
42+
### Labels applied by the Magento team
43+
We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more.
44+
Please review the [Code Contributions guide](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#labels) for detailed information on labels used in Magento 2 repositories.
4545

46-
<h2>Reporting security issues</h2>
46+
## Reporting security issues
4747

48-
To report security vulnerabilities in Magento software or web sites, please create a Bugcrowd researcher account <a href="https://bugcrowd.com/magento">there</a> to submit and follow-up your issue. Learn more about reporting security issues <a href="https://magento.com/security/reporting-magento-security-issue">here</a>.
48+
To report security vulnerabilities in Magento software or web sites, please create a Bugcrowd researcher account [there](https://bugcrowd.com/magento) to submit and follow-up your issue. Learn more about reporting security issues [here](https://magento.com/security/reporting-magento-security-issue).
4949

50-
Stay up-to-date on the latest security news and patches for Magento by signing up for <a href="https://magento.com/security/sign-up">Security Alert Notifications</a>.
50+
Stay up-to-date on the latest security news and patches for Magento by signing up for [Security Alert Notifications](https://magento.com/security/sign-up).
5151

52-
<h2>License</h2>
52+
## License
5353

5454
Each Magento source file included in this distribution is licensed under OSL 3.0 or the Magento Enterprise Edition (MEE) license.
5555

@@ -59,3 +59,13 @@ Please see [LICENSE.txt](https://github.com/magento/magento2/blob/2.3-develop/LI
5959
Subject to Licensee's payment of fees and compliance with the terms and conditions of the MEE License, the MEE License supersedes the OSL 3.0 license for each source file.
6060
Please see LICENSE_EE.txt for the full text of the MEE License or visit https://magento.com/legal/terms/enterprise.
6161

62+
## Community Engineering Slack
63+
64+
To connect with Magento and the Community, join us on the [Magento Community Engineering Slack](https://magentocommeng.slack.com). If you are interested in joining Slack, or a specific channel, send us request at [[email protected]](mailto:[email protected]) or [self signup](https://tinyurl.com/engcom-slack).
65+
66+
67+
We have channels for each project. These channels are recommended for new members:
68+
69+
- [general](https://magentocommeng.slack.com/messages/C4YS78WE6): Open chat for introductions and Magento 2 questions
70+
- [github](https://magentocommeng.slack.com/messages/C7KB93M32): Support for GitHub issues, pull requests, and processes
71+
- [public-backlog](https://magentocommeng.slack.com/messages/CCV3J3RV5): Discussions of the Magento 2 backlog

app/code/Magento/AdminNotification/Model/ResourceModel/Inbox.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Magento\AdminNotification\Model\ResourceModel;
77

88
/**
9+
* Inbox resource model
10+
*
911
* @api
1012
* @since 100.0.2
1113
*/
@@ -77,8 +79,7 @@ public function getNoticeStatus(\Magento\AdminNotification\Model\Inbox $object)
7779
'is_read=?',
7880
0
7981
);
80-
$return = $connection->fetchPairs($select);
81-
return $return;
82+
return $connection->fetchPairs($select);
8283
}
8384

8485
/**

app/code/Magento/AdminNotification/Model/System/Message/Media/Synchronization/Error.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
namespace Magento\AdminNotification\Model\System\Message\Media\Synchronization;
88

99
/**
10+
* Media synchronization error message class.
11+
*
1012
* @api
1113
* @since 100.0.2
1214
*/
@@ -27,7 +29,7 @@ class Error extends \Magento\AdminNotification\Model\System\Message\Media\Abstra
2729
protected function _shouldBeDisplayed()
2830
{
2931
$data = $this->_syncFlag->getFlagData();
30-
return isset($data['has_errors']) && true == $data['has_errors'];
32+
return !empty($data['has_errors']);
3133
}
3234

3335
/**

app/code/Magento/AdminNotification/Model/System/Message/Media/Synchronization/Success.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Magento\AdminNotification\Model\System\Message\Media\Synchronization;
77

88
/**
9+
* Media synchronization success message class.
10+
*
911
* @api
1012
* @since 100.0.2
1113
*/
@@ -27,8 +29,8 @@ protected function _shouldBeDisplayed()
2729
{
2830
$state = $this->_syncFlag->getState();
2931
$data = $this->_syncFlag->getFlagData();
30-
$hasErrors = isset($data['has_errors']) && true == $data['has_errors'] ? true : false;
31-
return false == $hasErrors && \Magento\MediaStorage\Model\File\Storage\Flag::STATE_FINISHED == $state;
32+
$hasErrors = !empty($data['has_errors']);
33+
return !$hasErrors && \Magento\MediaStorage\Model\File\Storage\Flag::STATE_FINISHED == $state;
3234
}
3335

3436
/**

app/code/Magento/Analytics/Model/Cryptographer.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,12 @@ private function getInitializationVector()
129129
*/
130130
private function validateCipherMethod($cipherMethod)
131131
{
132-
$methods = openssl_get_cipher_methods();
132+
$methods = array_map(
133+
'strtolower',
134+
openssl_get_cipher_methods()
135+
);
136+
$cipherMethod = strtolower($cipherMethod);
137+
133138
return (false !== array_search($cipherMethod, $methods));
134139
}
135140
}

app/code/Magento/Analytics/ReportXml/DB/ColumnsResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getColumns(SelectBuilder $selectBuilder, $entityConfig)
7676
$columnName = $this->nameResolver->getName($attributeData);
7777
if (isset($attributeData['function'])) {
7878
$prefix = '';
79-
if (isset($attributeData['distinct']) && $attributeData['distinct'] == true) {
79+
if (!empty($attributeData['distinct'])) {
8080
$prefix = ' DISTINCT ';
8181
}
8282
$expression = new ColumnValueExpression(

app/code/Magento/Analytics/Test/Unit/Model/ExportDataHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public function testPrepareExportData($isArchiveSourceDirectory)
191191
->with(
192192
$archiveSource,
193193
$archiveAbsolutePath,
194-
$isArchiveSourceDirectory ? true : false
194+
$isArchiveSourceDirectory
195195
);
196196

197197
$fileContent = 'Some text';
@@ -222,7 +222,7 @@ public function prepareExportDataDataProvider()
222222
{
223223
return [
224224
'Data source for archive is directory' => [true],
225-
'Data source for archive doesn\'t directory' => [false],
225+
'Data source for archive isn\'t directory' => [false],
226226
];
227227
}
228228

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+
declare(strict_types=1);
7+
8+
namespace Magento\Authorizenet\Block\Adminhtml\Order\View\Info;
9+
10+
use Magento\Framework\Phrase;
11+
use Magento\Payment\Block\ConfigurableInfo;
12+
13+
/**
14+
* Payment information block for Authorize.net payment method
15+
*/
16+
class PaymentDetails extends ConfigurableInfo
17+
{
18+
/**
19+
* Returns localized label for payment info block
20+
*
21+
* @param string $field
22+
* @return string | Phrase
23+
*/
24+
protected function getLabel($field)
25+
{
26+
return __($field);
27+
}
28+
}

app/code/Magento/Authorizenet/Model/Directpost.php

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Directpost extends \Magento\Authorizenet\Model\Authorizenet implements Tra
2727
/**
2828
* @var string
2929
*/
30-
protected $_infoBlockType = \Magento\Payment\Block\Info::class;
30+
protected $_infoBlockType = \Magento\Authorizenet\Block\Adminhtml\Order\View\Info\PaymentDetails::class;
3131

3232
/**
3333
* Payment Method feature
@@ -371,8 +371,7 @@ public function void(\Magento\Payment\Model\InfoInterface $payment)
371371
}
372372

373373
/**
374-
* Refund the amount
375-
* Need to decode last 4 digits for request.
374+
* Refund the amount need to decode last 4 digits for request.
376375
*
377376
* @param \Magento\Framework\DataObject|\Magento\Payment\Model\InfoInterface $payment
378377
* @param float $amount
@@ -626,6 +625,14 @@ protected function fillPaymentByResponse(\Magento\Framework\DataObject $payment)
626625
$payment->setIsTransactionPending(true)
627626
->setIsFraudDetected(true);
628627
}
628+
629+
$additionalInformationKeys = explode(',', $this->getValue('paymentInfoKeys'));
630+
foreach ($additionalInformationKeys as $paymentInfoKey) {
631+
$paymentInfoValue = $response->getDataByKey($paymentInfoKey);
632+
if ($paymentInfoValue !== null) {
633+
$payment->setAdditionalInformation($paymentInfoKey, $paymentInfoValue);
634+
}
635+
}
629636
}
630637

631638
/**
@@ -682,6 +689,7 @@ protected function matchAmount($amount)
682689

683690
/**
684691
* Operate with order using information from Authorize.net.
692+
*
685693
* Authorize order or authorize and capture it.
686694
*
687695
* @param \Magento\Sales\Model\Order $order
@@ -699,6 +707,7 @@ protected function processOrder(\Magento\Sales\Model\Order $order)
699707
//decline the order (in case of wrong response code) but don't return money to customer.
700708
$message = $e->getMessage();
701709
$this->declineOrder($order, $message, false);
710+
702711
throw $e;
703712
}
704713

@@ -769,7 +778,7 @@ protected function processPaymentFraudStatus(\Magento\Sales\Model\Order\Payment
769778
}
770779

771780
/**
772-
* Add status comment
781+
* Add status comment to history
773782
*
774783
* @param \Magento\Sales\Model\Order\Payment $payment
775784
* @return $this
@@ -824,6 +833,7 @@ protected function declineOrder(\Magento\Sales\Model\Order $order, $message = ''
824833
->void($response);
825834
}
826835
$order->registerCancellation($message)->save();
836+
$this->_eventManager->dispatch('order_cancel_after', ['order' => $order ]);
827837
} catch (\Exception $e) {
828838
//quiet decline
829839
$this->getPsrLogger()->critical($e);
@@ -858,7 +868,7 @@ public function getConfigInterface()
858868
* Getter for specified value according to set payment method code
859869
*
860870
* @param mixed $key
861-
* @param null $storeId
871+
* @param mixed $storeId
862872
* @return mixed
863873
*/
864874
public function getValue($key, $storeId = null)
@@ -918,10 +928,12 @@ public function fetchTransactionInfo(\Magento\Payment\Model\InfoInterface $payme
918928
$payment->setIsTransactionDenied(true);
919929
}
920930
$this->addStatusCommentOnUpdate($payment, $response, $transactionId);
921-
return [];
931+
return $response->getData();
922932
}
923933

924934
/**
935+
* Add status comment on update
936+
*
925937
* @param \Magento\Sales\Model\Order\Payment $payment
926938
* @param \Magento\Framework\DataObject $response
927939
* @param string $transactionId
@@ -996,8 +1008,9 @@ protected function getTransactionResponse($transactionId)
9961008
}
9971009

9981010
/**
999-
* @return \Psr\Log\LoggerInterface
1011+
* Get psr logger.
10001012
*
1013+
* @return \Psr\Log\LoggerInterface
10011014
* @deprecated 100.1.0
10021015
*/
10031016
private function getPsrLogger()
@@ -1038,7 +1051,9 @@ private function getOrderIncrementId(): string
10381051
}
10391052

10401053
/**
1041-
* Checks if filter action is Report Only. Transactions that trigger this filter are processed as normal,
1054+
* Checks if filter action is Report Only.
1055+
*
1056+
* Transactions that trigger this filter are processed as normal,
10421057
* but are also reported in the Merchant Interface as triggering this filter.
10431058
*
10441059
* @param string $fdsFilterAction

app/code/Magento/Authorizenet/etc/config.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<cgi_url>https://secure.authorize.net/gateway/transact.dll</cgi_url>
3333
<cgi_url_td_test_mode>https://apitest.authorize.net/xml/v1/request.api</cgi_url_td_test_mode>
3434
<cgi_url_td>https://api2.authorize.net/xml/v1/request.api</cgi_url_td>
35+
<paymentInfoKeys>x_card_type,x_account_number,x_avs_code,x_auth_code,x_response_reason_text,x_cvv2_resp_code</paymentInfoKeys>
3536
</authorizenet_directpost>
3637
</payment>
3738
</default>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@
3535
</argument>
3636
</arguments>
3737
</type>
38+
<type name="Magento\Authorizenet\Block\Adminhtml\Order\View\Info\PaymentDetails">
39+
<arguments>
40+
<argument name="config" xsi:type="object">Magento\Authorizenet\Model\Directpost</argument>
41+
</arguments>
42+
</type>
3843
</config>

app/code/Magento/Authorizenet/i18n/en_US.csv

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,9 @@ Debug,Debug
6767
"Minimum Order Total","Minimum Order Total"
6868
"Maximum Order Total","Maximum Order Total"
6969
"Sort Order","Sort Order"
70+
"x_card_type","Credit Card Type"
71+
"x_account_number", "Credit Card Number"
72+
"x_avs_code","AVS Response Code"
73+
"x_auth_code","Processor Authentication Code"
74+
"x_response_reason_text","Processor Response Text"
75+
"x_cvv2_resp_code","CVV2 Response Code"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ $fraudDetails = $payment->getAdditionalInformation('fraud_details');
4444
<?php endif; ?>
4545

4646
<?php if(!empty($fraudDetails['fraud_filters'])): ?>
47-
<b><?= $block->escapeHtml(__('Fraud Filters')) ?>:
48-
</b></br>
47+
<strong><?= $block->escapeHtml(__('Fraud Filters')) ?>:
48+
</strong></br>
4949
<?php foreach($fraudDetails['fraud_filters'] as $filter): ?>
5050
<?= $block->escapeHtml($filter['name']) ?>:
5151
<?= $block->escapeHtml($filter['action']) ?>

app/code/Magento/Authorizenet/view/frontend/requirejs-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
var config = {
77
map: {
88
'*': {
9-
transparent: 'Magento_Payment/js/transparent'
9+
transparent: 'Magento_Payment/js/transparent',
10+
'Magento_Payment/transparent': 'Magento_Payment/js/transparent'
1011
}
1112
}
1213
};

app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php

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

7+
namespace Magento\Backend\Block\Widget\Form\Element;
8+
79
/**
810
* Form element dependencies mapper
911
* Assumes that one element may depend on other element values.
1012
* Will toggle as "enabled" only if all elements it depends from toggle as true.
11-
*/
12-
namespace Magento\Backend\Block\Widget\Form\Element;
13-
14-
/**
13+
*
1514
* @api
1615
* @since 100.0.2
1716
*/
@@ -117,6 +116,7 @@ public function addConfigOptions(array $options)
117116

118117
/**
119118
* HTML output getter
119+
*
120120
* @return string
121121
*/
122122
protected function _toHtml()
@@ -139,7 +139,8 @@ protected function _toHtml()
139139
}
140140

141141
/**
142-
* Field dependences JSON map generator
142+
* Field dependencies JSON map generator
143+
*
143144
* @return string
144145
*/
145146
protected function _getDependsJson()

0 commit comments

Comments
 (0)