Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 6bc7575

Browse files
Merge pull request #2 from magento/2.2-develop
2.2 develop
2 parents 9688409 + 88e5cda commit 6bc7575

File tree

1,035 files changed

+49980
-19094
lines changed

Some content is hidden

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

1,035 files changed

+49980
-19094
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ atlassian*
3333
/.php_cs
3434
/.php_cs.cache
3535
/grunt-config.json
36-
/dev/tools/grunt/configs/local-themes.js
3736

3837
/pub/media/*.*
3938
!/pub/media/.htaccess

CHANGELOG.md

Lines changed: 147 additions & 0 deletions
Large diffs are not rendered by default.

app/code/Magento/AdminNotification/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"lib-libxml": "*"
1212
},
1313
"type": "magento2-module",
14-
"version": "100.2.4",
14+
"version": "100.2.5",
1515
"license": [
1616
"OSL-3.0",
1717
"AFL-3.0"

app/code/Magento/AdvancedPricingImportExport/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"magento/framework": "101.0.*"
1414
},
1515
"type": "magento2-module",
16-
"version": "100.2.4",
16+
"version": "100.2.5",
1717
"license": [
1818
"OSL-3.0",
1919
"AFL-3.0"

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,12 @@ private function getInitializationVector()
124124
*/
125125
private function validateCipherMethod($cipherMethod)
126126
{
127-
$methods = openssl_get_cipher_methods();
127+
$methods = array_map(
128+
'strtolower',
129+
openssl_get_cipher_methods()
130+
);
131+
$cipherMethod = strtolower($cipherMethod);
132+
128133
return (false !== array_search($cipherMethod, $methods));
129134
}
130135
}

app/code/Magento/Analytics/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"magento/framework": "101.0.*"
1111
},
1212
"type": "magento2-module",
13-
"version": "100.2.3",
13+
"version": "100.2.4",
1414
"license": [
1515
"OSL-3.0",
1616
"AFL-3.0"

app/code/Magento/Authorization/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"magento/framework": "101.0.*"
88
},
99
"type": "magento2-module",
10-
"version": "100.2.2",
10+
"version": "100.2.3",
1111
"license": [
1212
"OSL-3.0",
1313
"AFL-3.0"
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: 22 additions & 7 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
@@ -824,6 +832,7 @@ protected function declineOrder(\Magento\Sales\Model\Order $order, $message = ''
824832
->void($response);
825833
}
826834
$order->registerCancellation($message)->save();
835+
$this->_eventManager->dispatch('order_cancel_after', ['order' => $order ]);
827836
} catch (\Exception $e) {
828837
//quiet decline
829838
$this->getPsrLogger()->critical($e);
@@ -858,7 +867,7 @@ public function getConfigInterface()
858867
* Getter for specified value according to set payment method code
859868
*
860869
* @param mixed $key
861-
* @param null $storeId
870+
* @param int|string|null|\Magento\Store\Model\Store $storeId
862871
* @return mixed
863872
*/
864873
public function getValue($key, $storeId = null)
@@ -918,10 +927,13 @@ public function fetchTransactionInfo(\Magento\Payment\Model\InfoInterface $payme
918927
$payment->setIsTransactionDenied(true);
919928
}
920929
$this->addStatusCommentOnUpdate($payment, $response, $transactionId);
921-
return [];
930+
931+
return $response->getData();
922932
}
923933

924934
/**
935+
* Add statuc 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/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"magento/module-config": "101.0.*"
1717
},
1818
"type": "magento2-module",
19-
"version": "100.2.2",
19+
"version": "100.2.3",
2020
"license": [
2121
"proprietary"
2222
],

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/Backend/Block/System/Store/Delete/Form.php

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,39 @@
55
*/
66
namespace Magento\Backend\Block\System\Store\Delete;
77

8+
use Magento\Backup\Helper\Data as BackupHelper;
9+
use Magento\Framework\App\ObjectManager;
10+
811
/**
912
* Adminhtml cms block edit form
1013
*
1114
* @author Magento Core Team <[email protected]>
1215
*/
1316
class Form extends \Magento\Backend\Block\Widget\Form\Generic
1417
{
18+
/**
19+
* @var BackupHelper
20+
*/
21+
private $backup;
22+
23+
/**
24+
* @param \Magento\Backend\Block\Template\Context $context
25+
* @param \Magento\Framework\Registry $registry
26+
* @param \Magento\Framework\Data\FormFactory $formFactory
27+
* @param array $data
28+
* @param BackupHelper|null $backup
29+
*/
30+
public function __construct(
31+
\Magento\Backend\Block\Template\Context $context,
32+
\Magento\Framework\Registry $registry,
33+
\Magento\Framework\Data\FormFactory $formFactory,
34+
array $data = [],
35+
BackupHelper $backup = null
36+
) {
37+
parent::__construct($context, $registry, $formFactory, $data);
38+
$this->backup = $backup ?? ObjectManager::getInstance()->get(BackupHelper::class);
39+
}
40+
1541
/**
1642
* Init form
1743
*
@@ -25,7 +51,7 @@ protected function _construct()
2551
}
2652

2753
/**
28-
* {@inheritdoc}
54+
* @inheritDoc
2955
*/
3056
protected function _prepareForm()
3157
{
@@ -45,15 +71,21 @@ protected function _prepareForm()
4571

4672
$fieldset->addField('item_id', 'hidden', ['name' => 'item_id', 'value' => $dataObject->getId()]);
4773

74+
$backupOptions = ['0' => __('No')];
75+
$backupSelected = '0';
76+
if ($this->backup->isEnabled()) {
77+
$backupOptions['1'] = __('Yes');
78+
$backupSelected = '1';
79+
}
4880
$fieldset->addField(
4981
'create_backup',
5082
'select',
5183
[
5284
'label' => __('Create DB Backup'),
5385
'title' => __('Create DB Backup'),
5486
'name' => 'create_backup',
55-
'options' => ['1' => __('Yes'), '0' => __('No')],
56-
'value' => '1'
87+
'options' => $backupOptions,
88+
'value' => $backupSelected
5789
]
5890
);
5991

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected function _toHtml()
139139
}
140140

141141
/**
142-
* Field dependences JSON map generator
142+
* Field dependencies JSON map generator
143143
* @return string
144144
*/
145145
protected function _getDependsJson()

app/code/Magento/Backend/Controller/Adminhtml/System/Store.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* Store controller
1515
*
1616
* @author Magento Core Team <[email protected]>
17+
* @SuppressWarnings(PHPMD.AllPurposeAction)
1718
*/
1819
abstract class Store extends Action
1920
{
@@ -86,6 +87,8 @@ protected function createPage()
8687
* Backup database
8788
*
8889
* @return bool
90+
*
91+
* @deprecated Backup module is to be removed.
8992
*/
9093
protected function _backupDatabase()
9194
{

app/code/Magento/Backend/Model/AdminPathConfig.php

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,39 +48,38 @@ public function __construct(
4848
}
4949

5050
/**
51-
* {@inheritdoc}
52-
*
53-
* @param \Magento\Framework\App\RequestInterface $request
54-
* @return string
51+
* @inheritdoc
5552
*/
5653
public function getCurrentSecureUrl(\Magento\Framework\App\RequestInterface $request)
5754
{
5855
return $this->url->getBaseUrl('link', true) . ltrim($request->getPathInfo(), '/');
5956
}
6057

6158
/**
62-
* {@inheritdoc}
63-
*
64-
* @param string $path
65-
* @return bool
59+
* @inheritdoc
6660
*/
6761
public function shouldBeSecure($path)
6862
{
69-
return parse_url(
70-
(string)$this->coreConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, 'default'),
71-
PHP_URL_SCHEME
72-
) === 'https'
73-
|| $this->backendConfig->isSetFlag(Store::XML_PATH_SECURE_IN_ADMINHTML)
74-
&& parse_url(
75-
(string)$this->coreConfig->getValue(Store::XML_PATH_SECURE_BASE_URL, 'default'),
76-
PHP_URL_SCHEME
77-
) === 'https';
63+
$baseUrl = (string)$this->coreConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, 'default');
64+
if (parse_url($baseUrl, PHP_URL_SCHEME) === 'https') {
65+
return true;
66+
}
67+
68+
if ($this->backendConfig->isSetFlag(Store::XML_PATH_SECURE_IN_ADMINHTML)) {
69+
if ($this->backendConfig->isSetFlag('admin/url/use_custom')) {
70+
$adminBaseUrl = (string)$this->coreConfig->getValue('admin/url/custom', 'default');
71+
} else {
72+
$adminBaseUrl = (string)$this->coreConfig->getValue(Store::XML_PATH_SECURE_BASE_URL, 'default');
73+
}
74+
75+
return parse_url($adminBaseUrl, PHP_URL_SCHEME) === 'https';
76+
}
77+
78+
return false;
7879
}
7980

8081
/**
81-
* {@inheritdoc}
82-
*
83-
* @return string
82+
* @inheritdoc
8483
*/
8584
public function getDefaultPath()
8685
{

0 commit comments

Comments
 (0)