Skip to content

Commit 7df7324

Browse files
committed
Merge branch '2.3-develop' of github.com:magento/magento2ce into MAGETWO-96344
2 parents 47675cc + 3a42052 commit 7df7324

File tree

232 files changed

+3665
-831
lines changed

Some content is hidden

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

232 files changed

+3665
-831
lines changed

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
/**
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: 20 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
@@ -858,7 +866,7 @@ public function getConfigInterface()
858866
* Getter for specified value according to set payment method code
859867
*
860868
* @param mixed $key
861-
* @param null $storeId
869+
* @param int|string|null|\Magento\Store\Model\Store $storeId
862870
* @return mixed
863871
*/
864872
public function getValue($key, $storeId = null)
@@ -918,10 +926,12 @@ public function fetchTransactionInfo(\Magento\Payment\Model\InfoInterface $payme
918926
$payment->setIsTransactionDenied(true);
919927
}
920928
$this->addStatusCommentOnUpdate($payment, $response, $transactionId);
921-
return [];
929+
return $response->getData();
922930
}
923931

924932
/**
933+
* Add statuc comment on update.
934+
*
925935
* @param \Magento\Sales\Model\Order\Payment $payment
926936
* @param \Magento\Framework\DataObject $response
927937
* @param string $transactionId
@@ -996,8 +1006,9 @@ protected function getTransactionResponse($transactionId)
9961006
}
9971007

9981008
/**
999-
* @return \Psr\Log\LoggerInterface
1009+
* Get psr logger.
10001010
*
1011+
* @return \Psr\Log\LoggerInterface
10011012
* @deprecated 100.1.0
10021013
*/
10031014
private function getPsrLogger()
@@ -1038,7 +1049,9 @@ private function getOrderIncrementId(): string
10381049
}
10391050

10401051
/**
1041-
* Checks if filter action is Report Only. Transactions that trigger this filter are processed as normal,
1052+
* Checks if filter action is Report Only.
1053+
*
1054+
* Transactions that trigger this filter are processed as normal,
10421055
* but are also reported in the Merchant Interface as triggering this filter.
10431056
*
10441057
* @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/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/view/adminhtml/templates/system/cache/additional.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ $permissions = $block->getData('permissions');
1111
?>
1212
<?php if ($permissions && $permissions->hasAccessToAdditionalActions()): ?>
1313
<div class="additional-cache-management">
14+
<h2>
15+
<span><?= $block->escapeHtml(__('Additional Cache Management')); ?></span>
16+
</h2>
1417
<?php if ($permissions->hasAccessToFlushCatalogImages()): ?>
15-
<h2>
16-
<span><?= $block->escapeHtml(__('Additional Cache Management')); ?></span>
17-
</h2>
1818
<p>
1919
<button onclick="setLocation('<?= $block->escapeJs($block->getCleanImagesUrl()); ?>')" type="button">
2020
<?= $block->escapeHtml(__('Flush Catalog Images Cache')); ?>

app/code/Magento/Braintree/Controller/Paypal/PlaceOrder.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Braintree\Model\Paypal\Helper;
1010
use Magento\Checkout\Model\Session;
1111
use Magento\Framework\App\Action\Context;
12+
use Magento\Framework\App\Action\HttpPostActionInterface;
1213
use Magento\Framework\App\ObjectManager;
1314
use Magento\Framework\Controller\ResultFactory;
1415
use Magento\Framework\Exception\LocalizedException;
@@ -17,7 +18,7 @@
1718
/**
1819
* Class PlaceOrder
1920
*/
20-
class PlaceOrder extends AbstractAction
21+
class PlaceOrder extends AbstractAction implements HttpPostActionInterface
2122
{
2223
/**
2324
* @var Helper\OrderPlace
@@ -54,6 +55,7 @@ public function __construct(
5455

5556
/**
5657
* @inheritdoc
58+
*
5759
* @throws LocalizedException
5860
*/
5961
public function execute()
@@ -71,7 +73,10 @@ public function execute()
7173
return $resultRedirect->setPath('checkout/onepage/success', ['_secure' => true]);
7274
} catch (\Exception $e) {
7375
$this->logger->critical($e);
74-
$this->messageManager->addExceptionMessage($e, $e->getMessage());
76+
$this->messageManager->addExceptionMessage(
77+
$e,
78+
'The order #' . $quote->getReservedOrderId() . ' cannot be processed.'
79+
);
7580
}
7681

7782
return $resultRedirect->setPath('checkout/cart', ['_secure' => true]);

app/code/Magento/Braintree/Model/Paypal/Helper/OrderPlace.php

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66

77
namespace Magento\Braintree\Model\Paypal\Helper;
88

9-
use Magento\Quote\Model\Quote;
9+
use Magento\Braintree\Model\Paypal\OrderCancellationService;
10+
use Magento\Checkout\Api\AgreementsValidatorInterface;
1011
use Magento\Checkout\Helper\Data;
12+
use Magento\Checkout\Model\Type\Onepage;
1113
use Magento\Customer\Model\Group;
1214
use Magento\Customer\Model\Session;
13-
use Magento\Checkout\Model\Type\Onepage;
14-
use Magento\Quote\Api\CartManagementInterface;
1515
use Magento\Framework\Exception\LocalizedException;
16-
use Magento\Checkout\Api\AgreementsValidatorInterface;
16+
use Magento\Quote\Api\CartManagementInterface;
17+
use Magento\Quote\Model\Quote;
1718

1819
/**
1920
* Class OrderPlace
@@ -42,23 +43,29 @@ class OrderPlace extends AbstractHelper
4243
private $checkoutHelper;
4344

4445
/**
45-
* Constructor
46-
*
46+
* @var OrderCancellationService
47+
*/
48+
private $orderCancellationService;
49+
50+
/**
4751
* @param CartManagementInterface $cartManagement
4852
* @param AgreementsValidatorInterface $agreementsValidator
4953
* @param Session $customerSession
5054
* @param Data $checkoutHelper
55+
* @param OrderCancellationService $orderCancellationService
5156
*/
5257
public function __construct(
5358
CartManagementInterface $cartManagement,
5459
AgreementsValidatorInterface $agreementsValidator,
5560
Session $customerSession,
56-
Data $checkoutHelper
61+
Data $checkoutHelper,
62+
OrderCancellationService $orderCancellationService
5763
) {
5864
$this->cartManagement = $cartManagement;
5965
$this->agreementsValidator = $agreementsValidator;
6066
$this->customerSession = $customerSession;
6167
$this->checkoutHelper = $checkoutHelper;
68+
$this->orderCancellationService = $orderCancellationService;
6269
}
6370

6471
/**
@@ -67,7 +74,7 @@ public function __construct(
6774
* @param Quote $quote
6875
* @param array $agreement
6976
* @return void
70-
* @throws LocalizedException
77+
* @throws \Exception
7178
*/
7279
public function execute(Quote $quote, array $agreement)
7380
{
@@ -84,7 +91,12 @@ public function execute(Quote $quote, array $agreement)
8491
$this->disabledQuoteAddressValidation($quote);
8592

8693
$quote->collectTotals();
87-
$this->cartManagement->placeOrder($quote->getId());
94+
try {
95+
$this->cartManagement->placeOrder($quote->getId());
96+
} catch (\Exception $e) {
97+
$this->orderCancellationService->execute($quote->getReservedOrderId());
98+
throw $e;
99+
}
88100
}
89101

90102
/**

0 commit comments

Comments
 (0)