Skip to content

Commit

Permalink
Merge remote-tracking branch 'mainline/2.2-develop' into issue-18548
Browse files Browse the repository at this point in the history
  • Loading branch information
nmalevanec committed Apr 12, 2019
2 parents 8611d14 + 51fcebd commit bbe03ea
Show file tree
Hide file tree
Showing 2,264 changed files with 84,535 additions and 30,355 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ atlassian*
/.php_cs
/.php_cs.cache
/grunt-config.json
/dev/tools/grunt/configs/local-themes.js

/pub/media/*.*
!/pub/media/.htaccess
Expand All @@ -50,6 +49,8 @@ atlassian*
/pub/media/import/*
!/pub/media/import/.htaccess
/pub/media/logo/*
/pub/media/custom_options/*
!/pub/media/custom_options/.htaccess
/pub/media/theme/*
/pub/media/theme_customization/*
!/pub/media/theme_customization/.htaccess
Expand Down
11 changes: 11 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

############################################
## default index file
## Specifies option, to use methods arguments in backtrace or not
SetEnv MAGE_DEBUG_SHOW_ARGS 1

DirectoryIndex index.php

Expand Down Expand Up @@ -364,6 +366,15 @@
Require all denied
</IfVersion>
</Files>
<Files .user.ini>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>

# For 404s and 403s that aren't handled by the application, show plain 404 response
ErrorDocument 404 /pub/errors/404.php
Expand Down
9 changes: 9 additions & 0 deletions .htaccess.sample
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,15 @@
Require all denied
</IfVersion>
</Files>
<Files .user.ini>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>

# For 404s and 403s that aren't handled by the application, show plain 404 response
ErrorDocument 404 /pub/errors/404.php
Expand Down
620 changes: 620 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Environment initialization
*/
error_reporting(E_ALL);
stream_wrapper_unregister('phar');
#ini_set('display_errors', 1);

/* PHP version validation */
Expand Down
23 changes: 15 additions & 8 deletions app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

namespace Magento\AdminNotification\Block\Grid\Renderer;

/**
* Renderer class for action in the admin notifications grid.
*/
class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
{
/**
Expand Down Expand Up @@ -37,19 +40,23 @@ public function __construct(
*/
public function render(\Magento\Framework\DataObject $row)
{
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">' .
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' .
$this->escapeUrl($row->getUrl())
. '">' .
__('Read Details') . '</a>' : '';

$markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl(
'*/*/markAsRead/',
['_current' => true, 'id' => $row->getId()]
) . '">' . __(
'Mark as Read'
) . '</a>' : '';
$markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' .
$this->getUrl(
'*/*/markAsRead/',
['_current' => true, 'id' => $row->getId()]
) . '">' . __(
'Mark as Read'
) . '</a>' : '';

$encodedUrl = $this->_urlHelper->getEncodedUrl();
return sprintf(
'%s%s<a class="action-delete" href="%s" onClick="deleteConfirm(\'%s\', this.href); return false;">%s</a>',
'%s%s<a class="action-delete" href="%s" onclick="deleteConfirm(\'%s\', this.href, {data: {}});' .
' return false;">%s</a>',
$readDetailsHtml,
$markAsReadHtml,
$this->getUrl(
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdminNotification/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lib-libxml": "*"
},
"type": "magento2-module",
"version": "100.2.4",
"version": "100.2.6",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdvancedPricingImportExport/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"magento/framework": "101.0.*"
},
"type": "magento2-module",
"version": "100.2.4",
"version": "100.2.5",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
7 changes: 6 additions & 1 deletion app/code/Magento/Analytics/Model/Cryptographer.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ private function getInitializationVector()
*/
private function validateCipherMethod($cipherMethod)
{
$methods = openssl_get_cipher_methods();
$methods = array_map(
'strtolower',
openssl_get_cipher_methods()
);
$cipherMethod = strtolower($cipherMethod);

return (false !== array_search($cipherMethod, $methods));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AdditionalCommentTest extends \PHPUnit\Framework\TestCase
protected function setUp()
{
$this->abstractElementMock = $this->getMockBuilder(AbstractElement::class)
->setMethods(['getComment', 'getLabel'])
->setMethods(['getComment', 'getLabel', 'getHtmlId', 'getName'])
->disableOriginalConstructor()
->getMock();
$this->contextMock = $this->getMockBuilder(Context::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CollectionTimeLabelTest extends \PHPUnit\Framework\TestCase
protected function setUp()
{
$this->abstractElementMock = $this->getMockBuilder(AbstractElement::class)
->setMethods(['getComment'])
->setMethods(['getComment', 'getHtmlId', 'getName'])
->disableOriginalConstructor()
->getMock();
$this->contextMock = $this->getMockBuilder(Context::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function setUp()
->disableOriginalConstructor()
->getMock();
$this->abstractElementMock = $this->getMockBuilder(AbstractElement::class)
->setMethods(['getComment'])
->setMethods(['getComment', 'getHtmlId', 'getName'])
->disableOriginalConstructor()
->getMock();
$this->formMock = $this->getMockBuilder(Form::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class VerticalTest extends \PHPUnit\Framework\TestCase
protected function setUp()
{
$this->abstractElementMock = $this->getMockBuilder(AbstractElement::class)
->setMethods(['getComment', 'getLabel', 'getHint'])
->setMethods(['getComment', 'getLabel', 'getHint', 'getHtmlId', 'getName'])
->disableOriginalConstructor()
->getMock();
$this->contextMock = $this->getMockBuilder(Context::class)
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Analytics/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"magento/framework": "101.0.*"
},
"type": "magento2-module",
"version": "100.2.3",
"version": "100.2.5",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Authorization/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"magento/framework": "101.0.*"
},
"type": "magento2-module",
"version": "100.2.2",
"version": "100.2.3",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Authorizenet\Block\Adminhtml\Order\View\Info;

use Magento\Framework\Phrase;
use Magento\Payment\Block\ConfigurableInfo;

/**
* Payment information block for Authorize.net payment method.
*/
class PaymentDetails extends ConfigurableInfo
{
/**
* Returns localized label for payment info block.
*
* @param string $field
* @return string | Phrase
*/
protected function getLabel($field)
{
return __($field);
}
}
38 changes: 27 additions & 11 deletions app/code/Magento/Authorizenet/Model/Directpost.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Directpost extends \Magento\Authorizenet\Model\Authorizenet implements Tra
/**
* @var string
*/
protected $_infoBlockType = \Magento\Payment\Block\Info::class;
protected $_infoBlockType = \Magento\Authorizenet\Block\Adminhtml\Order\View\Info\PaymentDetails::class;

/**
* Payment Method feature
Expand Down Expand Up @@ -371,8 +371,7 @@ public function void(\Magento\Payment\Model\InfoInterface $payment)
}

/**
* Refund the amount
* Need to decode last 4 digits for request.
* Refund the amount need to decode last 4 digits for request.
*
* @param \Magento\Framework\DataObject|\Magento\Payment\Model\InfoInterface $payment
* @param float $amount
Expand Down Expand Up @@ -544,15 +543,16 @@ public function setResponseData(array $postData)
public function validateResponse()
{
$response = $this->getResponse();
//md5 check
if (!$this->getConfigData('trans_md5')
|| !$this->getConfigData('login')
|| !$response->isValidHash($this->getConfigData('trans_md5'), $this->getConfigData('login'))
$hashConfigKey = !empty($response->getData('x_SHA2_Hash')) ? 'signature_key' : 'trans_md5';

//hash check
if (!$response->isValidHash($this->getConfigData($hashConfigKey), $this->getConfigData('login'))
) {
throw new \Magento\Framework\Exception\LocalizedException(
__('The transaction was declined because the response hash validation failed.')
);
}

return true;
}

Expand Down Expand Up @@ -626,6 +626,14 @@ protected function fillPaymentByResponse(\Magento\Framework\DataObject $payment)
$payment->setIsTransactionPending(true)
->setIsFraudDetected(true);
}

$additionalInformationKeys = explode(',', $this->getValue('paymentInfoKeys'));
foreach ($additionalInformationKeys as $paymentInfoKey) {
$paymentInfoValue = $response->getDataByKey($paymentInfoKey);
if ($paymentInfoValue !== null) {
$payment->setAdditionalInformation($paymentInfoKey, $paymentInfoValue);
}
}
}

/**
Expand Down Expand Up @@ -682,6 +690,7 @@ protected function matchAmount($amount)

/**
* Operate with order using information from Authorize.net.
*
* Authorize order or authorize and capture it.
*
* @param \Magento\Sales\Model\Order $order
Expand Down Expand Up @@ -824,6 +833,7 @@ protected function declineOrder(\Magento\Sales\Model\Order $order, $message = ''
->void($response);
}
$order->registerCancellation($message)->save();
$this->_eventManager->dispatch('order_cancel_after', ['order' => $order ]);
} catch (\Exception $e) {
//quiet decline
$this->getPsrLogger()->critical($e);
Expand Down Expand Up @@ -858,7 +868,7 @@ public function getConfigInterface()
* Getter for specified value according to set payment method code
*
* @param mixed $key
* @param null $storeId
* @param int|string|null|\Magento\Store\Model\Store $storeId
* @return mixed
*/
public function getValue($key, $storeId = null)
Expand Down Expand Up @@ -918,10 +928,13 @@ public function fetchTransactionInfo(\Magento\Payment\Model\InfoInterface $payme
$payment->setIsTransactionDenied(true);
}
$this->addStatusCommentOnUpdate($payment, $response, $transactionId);
return [];

return $response->getData();
}

/**
* Add statuc comment on update.
*
* @param \Magento\Sales\Model\Order\Payment $payment
* @param \Magento\Framework\DataObject $response
* @param string $transactionId
Expand Down Expand Up @@ -996,8 +1009,9 @@ protected function getTransactionResponse($transactionId)
}

/**
* @return \Psr\Log\LoggerInterface
* Get psr logger.
*
* @return \Psr\Log\LoggerInterface
* @deprecated 100.1.0
*/
private function getPsrLogger()
Expand Down Expand Up @@ -1038,7 +1052,9 @@ private function getOrderIncrementId(): string
}

/**
* Checks if filter action is Report Only. Transactions that trigger this filter are processed as normal,
* Checks if filter action is Report Only.
*
* Transactions that trigger this filter are processed as normal,
* but are also reported in the Merchant Interface as triggering this filter.
*
* @param string $fdsFilterAction
Expand Down
Loading

0 comments on commit bbe03ea

Please sign in to comment.