Skip to content

Commit

Permalink
Merge branch '2.3-develop' into fix-issue-port-19328
Browse files Browse the repository at this point in the history
  • Loading branch information
speedy008 authored Jan 29, 2019
2 parents 67c59ec + 2957731 commit da33798
Show file tree
Hide file tree
Showing 1,813 changed files with 42,156 additions and 10,779 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The Magento 2 development team will review all issues and contributions submitte
4. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug.
3. PRs which include new logic or new features must be submitted along with:
* Unit/integration test coverage
* Proposed [documentation](http://devdocs.magento.com) updates. Documentation contributions can be submitted via the [devdocs GitHub](https://github.com/magento/devdocs).
* Proposed [documentation](https://devdocs.magento.com) updates. Documentation contributions can be submitted via the [devdocs GitHub](https://github.com/magento/devdocs).
4. For larger features or changes, please [open an issue](https://github.com/magento/magento2/issues) to discuss the proposed changes prior to development. This may prevent duplicate or unnecessary effort and allow other contributors to provide input.
5. All automated tests must pass (all builds on [Travis CI](https://travis-ci.org/magento/magento2) must be green).

Expand All @@ -27,7 +27,7 @@ If you are a new GitHub user, we recommend that you create your own [free github
1. Search current [listed issues](https://github.com/magento/magento2/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution.
2. Review the [Contributor License Agreement](https://magento.com/legaldocuments/mca) if this is your first time contributing.
3. Create and test your work.
4. Fork the Magento 2 repository according to the [Fork A Repository instructions](http://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](http://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#pull_request).
4. Fork the Magento 2 repository according to the [Fork A Repository instructions](https://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](https://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#pull_request).
5. Once your contribution is received the Magento 2 development team will review the contribution and collaborate with you as needed.

## Code of Conduct
Expand Down
1 change: 0 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
/pub/media/attribute/*
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ script:

# The scripts for grunt/phpunit type tests
- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js"] && [ $TEST_SUITE != "graphql-api-functional" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ] && [ $TEST_SUITE != "graphql-api-functional" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi
- if [ $TEST_SUITE == "graphql-api-functional" ]; then phpunit -c dev/tests/api-functional; fi
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ To get detailed information about changes in Magento 2.3.0, see the [Release Not

2.1.0
=============
To get detailed information about changes in Magento 2.1.0, please visit [Magento Community Edition (CE) Release Notes](http://devdocs.magento.com/guides/v2.1/release-notes/ReleaseNotes2.1.0CE.html "Magento Community Edition (CE) Release Notes")
To get detailed information about changes in Magento 2.1.0, please visit [Magento Community Edition (CE) Release Notes](https://devdocs.magento.com/guides/v2.1/release-notes/ReleaseNotes2.1.0CE.html "Magento Community Edition (CE) Release Notes")

2.0.0
=============
Expand Down Expand Up @@ -1025,7 +1025,7 @@ Tests:
* Improved backend menu keyboard accessibility
* Accessibility improvements: WAI-ARIA in a product item on a category page and related products
* Checkout flow code can work with a separate DB storage
* <a href="http://devdocs.magento.com/guides/v1.0/release-notes/changes.html#change-devrc-unit">Unit tests moved to module directories</a>
* <a href="https://devdocs.magento.com/guides/v1.0/release-notes/changes.html#change-devrc-unit">Unit tests moved to module directories</a>
* Addressed naming inconsistencies in REST routes
* Added Advanced Developer workflow for frontend developers
* Setup
Expand Down
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ Magento is thankful for any contribution that can improve our code base, documen
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png"/>
</a>

<h3>Labels applied by the Magento team</h3>
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.
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.
### Labels applied by the Magento team
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.
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.

<h2>Reporting security issues</h2>
## Reporting security issues

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>.
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).

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>.
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).

<h2>License</h2>
## License

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

Expand All @@ -59,3 +59,13 @@ Please see [LICENSE.txt](https://github.com/magento/magento2/blob/2.3-develop/LI
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.
Please see LICENSE_EE.txt for the full text of the MEE License or visit https://magento.com/legal/terms/enterprise.

## Community Engineering Slack

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).


We have channels for each project. These channels are recommended for new members:

- [general](https://magentocommeng.slack.com/messages/C4YS78WE6): Open chat for introductions and Magento 2 questions
- [github](https://magentocommeng.slack.com/messages/C7KB93M32): Support for GitHub issues, pull requests, and processes
- [public-backlog](https://magentocommeng.slack.com/messages/CCV3J3RV5): Discussions of the Magento 2 backlog
3 changes: 3 additions & 0 deletions app/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
/* 'composer install' validation */
if (file_exists($vendorAutoload)) {
$composerAutoloader = include $vendorAutoload;
} else if (file_exists("{$vendorDir}/autoload.php")) {
$vendorAutoload = "{$vendorDir}/autoload.php";
$composerAutoloader = include $vendorAutoload;
} else {
throw new \Exception(
'Vendor autoload is not found. Please run \'composer install\' under application root directory.'
Expand Down
10 changes: 5 additions & 5 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
#ini_set('display_errors', 1);

/* PHP version validation */
if (!defined('PHP_VERSION_ID') || !(PHP_VERSION_ID === 70002 || PHP_VERSION_ID === 70004 || PHP_VERSION_ID >= 70006)) {
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 70103) {
if (PHP_SAPI == 'cli') {
echo 'Magento supports 7.0.2, 7.0.4, and 7.0.6 or later. ' .
'Please read http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements.html';
echo 'Magento supports PHP 7.1.3 or later. ' .
'Please read https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html';
} else {
echo <<<HTML
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
<p>Magento supports PHP 7.0.2, 7.0.4, and 7.0.6 or later. Please read
<a target="_blank" href="http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements.html">
<p>Magento supports PHP 7.1.3 or later. Please read
<a target="_blank" href="https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html">
Magento System Requirements</a>.
</div>
HTML;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
namespace Magento\AdminNotification\Model\ResourceModel;

/**
* Inbox resource model
*
* @api
* @since 100.0.2
*/
Expand Down Expand Up @@ -77,8 +79,7 @@ public function getNoticeStatus(\Magento\AdminNotification\Model\Inbox $object)
'is_read=?',
0
);
$return = $connection->fetchPairs($select);
return $return;
return $connection->fetchPairs($select);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
namespace Magento\AdminNotification\Model\System\Message\Media\Synchronization;

/**
* Media synchronization error message class.
*
* @api
* @since 100.0.2
*/
Expand All @@ -27,7 +29,7 @@ class Error extends \Magento\AdminNotification\Model\System\Message\Media\Abstra
protected function _shouldBeDisplayed()
{
$data = $this->_syncFlag->getFlagData();
return isset($data['has_errors']) && true == $data['has_errors'];
return !empty($data['has_errors']);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
namespace Magento\AdminNotification\Model\System\Message\Media\Synchronization;

/**
* Media synchronization success message class.
*
* @api
* @since 100.0.2
*/
Expand All @@ -27,8 +29,8 @@ protected function _shouldBeDisplayed()
{
$state = $this->_syncFlag->getState();
$data = $this->_syncFlag->getFlagData();
$hasErrors = isset($data['has_errors']) && true == $data['has_errors'] ? true : false;
return false == $hasErrors && \Magento\MediaStorage\Model\File\Storage\Flag::STATE_FINISHED == $state;
$hasErrors = !empty($data['has_errors']);
return !$hasErrors && \Magento\MediaStorage\Model\File\Storage\Flag::STATE_FINISHED == $state;
}

/**
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 @@ -129,7 +129,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));
}
}
6 changes: 3 additions & 3 deletions app/code/Magento/Analytics/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Magento_Analytics Module

The Magento_Analytics module integrates your Magento instance with the [Magento Business Intelligence (MBI)](https://magento.com/products/business-intelligence) to use [Advanced Reporting](http://devdocs.magento.com/guides/v2.2/advanced-reporting/modules.html) functionality.
The Magento_Analytics module integrates your Magento instance with the [Magento Business Intelligence (MBI)](https://magento.com/products/business-intelligence) to use [Advanced Reporting](https://devdocs.magento.com/guides/v2.2/advanced-reporting/modules.html) functionality.

The module implements the following functionality:

Expand All @@ -16,8 +16,8 @@ The module implements the following functionality:

## Structure

Beyond the [usual module file structure](http://devdocs.magento.com/guides/v2.2/architecture/archi_perspectives/components/modules/mod_intro.html) the module contains a directory `ReportXml`.
[Report XML](http://devdocs.magento.com/guides/v2.2/advanced-reporting/report-xml.html) is a markup language used to build reports for Advanced Reporting.
Beyond the [usual module file structure](https://devdocs.magento.com/guides/v2.2/architecture/archi_perspectives/components/modules/mod_intro.html) the module contains a directory `ReportXml`.
[Report XML](https://devdocs.magento.com/guides/v2.2/advanced-reporting/report-xml.html) is a markup language used to build reports for Advanced Reporting.
The language declares SQL queries using XML declaration.

## Subscription Process
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function getColumns(SelectBuilder $selectBuilder, $entityConfig)
$columnName = $this->nameResolver->getName($attributeData);
if (isset($attributeData['function'])) {
$prefix = '';
if (isset($attributeData['distinct']) && $attributeData['distinct'] == true) {
if (!empty($attributeData['distinct'])) {
$prefix = ' DISTINCT ';
}
$expression = new ColumnValueExpression(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
<severity value="MAJOR"/>
<testCaseId value="MAGETWO-63898"/>
<group value="analytics"/>
<skip>
<issueId value="MAGETWO-96223"/>
</skip>
</annotations>

<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function testPrepareExportData($isArchiveSourceDirectory)
->with(
$archiveSource,
$archiveAbsolutePath,
$isArchiveSourceDirectory ? true : false
$isArchiveSourceDirectory
);

$fileContent = 'Some text';
Expand Down Expand Up @@ -222,7 +222,7 @@ public function prepareExportDataDataProvider()
{
return [
'Data source for archive is directory' => [true],
'Data source for archive doesn\'t directory' => [false],
'Data source for archive isn\'t directory' => [false],
];
}

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);
}
}
31 changes: 23 additions & 8 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 @@ -626,6 +625,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 +689,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 All @@ -699,6 +707,7 @@ protected function processOrder(\Magento\Sales\Model\Order $order)
//decline the order (in case of wrong response code) but don't return money to customer.
$message = $e->getMessage();
$this->declineOrder($order, $message, false);

throw $e;
}

Expand Down Expand Up @@ -769,7 +778,7 @@ protected function processPaymentFraudStatus(\Magento\Sales\Model\Order\Payment
}

/**
* Add status comment
* Add status comment to history
*
* @param \Magento\Sales\Model\Order\Payment $payment
* @return $this
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 mixed $storeId
* @return mixed
*/
public function getValue($key, $storeId = null)
Expand Down Expand Up @@ -918,10 +928,12 @@ public function fetchTransactionInfo(\Magento\Payment\Model\InfoInterface $payme
$payment->setIsTransactionDenied(true);
}
$this->addStatusCommentOnUpdate($payment, $response, $transactionId);
return [];
return $response->getData();
}

/**
* Add status comment on update
*
* @param \Magento\Sales\Model\Order\Payment $payment
* @param \Magento\Framework\DataObject $response
* @param string $transactionId
Expand Down Expand Up @@ -996,8 +1008,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 +1051,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
2 changes: 2 additions & 0 deletions app/code/Magento/Authorizenet/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<cgi_url>https://secure.authorize.net/gateway/transact.dll</cgi_url>
<cgi_url_td_test_mode>https://apitest.authorize.net/xml/v1/request.api</cgi_url_td_test_mode>
<cgi_url_td>https://api2.authorize.net/xml/v1/request.api</cgi_url_td>
<paymentInfoKeys>x_card_type,x_account_number,x_avs_code,x_auth_code,x_response_reason_text,x_cvv2_resp_code</paymentInfoKeys>
<group>authorizenet</group>
</authorizenet_directpost>
</payment>
</default>
Expand Down
Loading

0 comments on commit da33798

Please sign in to comment.