Skip to content

Commit 0e91993

Browse files
merge magento/2.3-develop into magento-trigger/MC-16650
2 parents 646df1b + d9d4b82 commit 0e91993

File tree

420 files changed

+13958
-2429
lines changed

Some content is hidden

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

420 files changed

+13958
-2429
lines changed

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
5050

5151
const VALIDATOR_WEBSITE = 'validator_website';
5252

53-
const VALIDATOR_TEAR_PRICE = 'validator_tear_price';
53+
/**
54+
* @deprecated
55+
* @see VALIDATOR_TIER_PRICE
56+
*/
57+
private const VALIDATOR_TEAR_PRICE = 'validator_tier_price';
58+
59+
private const VALIDATOR_TIER_PRICE = 'validator_tier_price';
5460

5561
/**
5662
* Validation failure message template definitions.
@@ -221,7 +227,7 @@ public function __construct(
221227
$this->_catalogProductEntity = $this->_resourceFactory->create()->getTable('catalog_product_entity');
222228
$this->_oldSkus = $this->retrieveOldSkus();
223229
$this->_validators[self::VALIDATOR_WEBSITE] = $websiteValidator;
224-
$this->_validators[self::VALIDATOR_TEAR_PRICE] = $tierPriceValidator;
230+
$this->_validators[self::VALIDATOR_TIER_PRICE] = $tierPriceValidator;
225231
$this->errorAggregator = $errorAggregator;
226232

227233
foreach (array_merge($this->errorMessageTemplates, $this->_messageTemplates) as $errorCode => $message) {
@@ -536,7 +542,7 @@ protected function getWebSiteId($websiteCode)
536542
*/
537543
protected function getCustomerGroupId($customerGroup)
538544
{
539-
$customerGroups = $this->_getValidator(self::VALIDATOR_TEAR_PRICE)->getCustomerGroups();
545+
$customerGroups = $this->_getValidator(self::VALIDATOR_TIER_PRICE)->getCustomerGroups();
540546
return $customerGroup == self::VALUE_ALL_GROUPS ? 0 : $customerGroups[$customerGroup];
541547
}
542548

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
class AdvancedPricingTest extends \Magento\ImportExport\Test\Unit\Model\Import\AbstractImportTestCase
1717
{
18+
/**
19+
* DB Table data
20+
*/
1821
const TABLE_NAME = 'tableName';
1922
const LINK_FIELD = 'linkField';
2023

@@ -54,7 +57,7 @@ class AdvancedPricingTest extends \Magento\ImportExport\Test\Unit\Model\Import\A
5457
protected $websiteValidator;
5558

5659
/**
57-
* @var AdvancedPricing\Validator\TearPrice |\PHPUnit_Framework_MockObject_MockObject
60+
* @var AdvancedPricing\Validator\TierPrice |\PHPUnit_Framework_MockObject_MockObject
5861
*/
5962
protected $tierPriceValidator;
6063

app/code/Magento/AmqpStore/Plugin/Framework/Amqp/Bulk/Exchange.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public function beforeEnqueue(SubjectExchange $subject, $topic, array $envelopes
9191
if ($headers instanceof AMQPTable) {
9292
try {
9393
$headers->set('store_id', $storeId);
94-
// phpcs:ignore Magento2.Exceptions.ThrowCatch
9594
} catch (AMQPInvalidArgumentException $ea) {
9695
$errorMessage = sprintf("Can't set storeId to amqp message. Error %s.", $ea->getMessage());
9796
$this->logger->error($errorMessage);
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,42 @@
1+
# Magento_Authorizenet module
2+
13
The Magento_Authorizenet module implements the integration with the Authorize.Net payment gateway and makes the latter available as a payment method in Magento.
4+
5+
## Extensibility
6+
7+
Extension developers can interact with the Magento_Authorizenet module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).
8+
9+
[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Authorizenet module.
10+
11+
### Events
12+
13+
This module dispatches the following events:
14+
15+
- `checkout_directpost_placeOrder` event in the `\Magento\Authorizenet\Controller\Directpost\Payment\Place::placeCheckoutOrder()` method. Parameters:
16+
- `result` is a data object (`\Magento\Framework\DataObject` class).
17+
- `action` is a controller object (`\Magento\Authorizenet\Controller\Directpost\Payment\Place`).
18+
19+
- `order_cancel_after` event in the `\Magento\Authorizenet\Model\Directpost::declineOrder()` method. Parameters:
20+
- `order` is an order object (`\Magento\Sales\Model\Order` class).
21+
22+
23+
This module observes the following events:
24+
25+
- `checkout_submit_all_after` event in the `Magento\Authorizenet\Observer\SaveOrderAfterSubmitObserver` file.
26+
- `checkout_directpost_placeOrder` event in the `Magento\Authorizenet\Observer\AddFieldsToResponseObserver` file.
27+
28+
For information about events in Magento 2, see [Events and observers](http://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html#events).
29+
30+
### Layouts
31+
32+
This module introduces the following layouts and layout handles in the `view/adminhtml/layout` directory:
33+
34+
- `adminhtml_authorizenet_directpost_payment_redirect`
35+
36+
This module introduces the following layouts and layout handles in the `view/frontend/layout` directory:
37+
38+
- `authorizenet_directpost_payment_backendresponse`
39+
- `authorizenet_directpost_payment_redirect`
40+
- `authorizenet_directpost_payment_response`
41+
42+
For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html).

app/code/Magento/AuthorizenetGraphQl/Model/AuthorizenetDataProvider.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\QuoteGraphQl\Model\Cart\Payment\AdditionalDataProviderInterface;
1111
use Magento\Framework\Stdlib\ArrayManager;
12+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1213

1314
/**
1415
* SetPaymentMethod additional data provider model for Authorizenet payment method
@@ -36,10 +37,32 @@ public function __construct(
3637
*
3738
* @param array $data
3839
* @return array
40+
* @throws GraphQlInputException
3941
*/
4042
public function getData(array $data): array
4143
{
42-
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $data) ?? [];
44+
if (!isset($data[self::PATH_ADDITIONAL_DATA])) {
45+
throw new GraphQlInputException(
46+
__('Required parameter "authorizenet_acceptjs" for "payment_method" is missing.')
47+
);
48+
}
49+
if (!isset($data[self::PATH_ADDITIONAL_DATA]['opaque_data_descriptor'])) {
50+
throw new GraphQlInputException(
51+
__('Required parameter "opaque_data_descriptor" for "authorizenet_acceptjs" is missing.')
52+
);
53+
}
54+
if (!isset($data[self::PATH_ADDITIONAL_DATA]['opaque_data_value'])) {
55+
throw new GraphQlInputException(
56+
__('Required parameter "opaque_data_value" for "authorizenet_acceptjs" is missing.')
57+
);
58+
}
59+
if (!isset($data[self::PATH_ADDITIONAL_DATA]['cc_last_4'])) {
60+
throw new GraphQlInputException(
61+
__('Required parameter "cc_last_4" for "authorizenet_acceptjs" is missing.')
62+
);
63+
}
64+
65+
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $data);
4366
foreach ($additionalData as $key => $value) {
4467
$additionalData[$this->convertSnakeCaseToCamelCase($key)] = $value;
4568
unset($additionalData[$key]);

app/code/Magento/Backup/Controller/Adminhtml/Index/Rollback.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ public function execute()
127127
$adminSession->destroy();
128128

129129
$response->setRedirectUrl($this->getUrl('*'));
130-
// phpcs:disable Magento2.Exceptions.ThrowCatch
131130
} catch (\Magento\Framework\Backup\Exception\CantLoadSnapshot $e) {
132131
$errorMsg = __('We can\'t find the backup file.');
133132
} catch (\Magento\Framework\Backup\Exception\FtpConnectionFailed $e) {
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Braintree\Gateway\Request;
7+
8+
use Magento\Payment\Gateway\Request\BuilderInterface;
9+
use Magento\Braintree\Gateway\SubjectReader;
10+
11+
/**
12+
* Class BillingAddressDataBuilder
13+
*/
14+
class BillingAddressDataBuilder implements BuilderInterface
15+
{
16+
/**
17+
* @var SubjectReader
18+
*/
19+
private $subjectReader;
20+
21+
/**
22+
* BillingAddress block name
23+
*/
24+
private const BILLING_ADDRESS = 'billing';
25+
26+
/**
27+
* The customer’s company. 255 character maximum.
28+
*/
29+
private const COMPANY = 'company';
30+
31+
/**
32+
* The first name value must be less than or equal to 255 characters.
33+
*/
34+
private const FIRST_NAME = 'firstName';
35+
36+
/**
37+
* The last name value must be less than or equal to 255 characters.
38+
*/
39+
private const LAST_NAME = 'lastName';
40+
41+
/**
42+
* The street address. Maximum 255 characters, and must contain at least 1 digit.
43+
* Required when AVS rules are configured to require street address.
44+
*/
45+
private const STREET_ADDRESS = 'streetAddress';
46+
47+
/**
48+
* The postal code. Postal code must be a string of 5 or 9 alphanumeric digits,
49+
* optionally separated by a dash or a space. Spaces, hyphens,
50+
* and all other special characters are ignored.
51+
*/
52+
private const POSTAL_CODE = 'postalCode';
53+
54+
/**
55+
* The ISO 3166-1 alpha-2 country code specified in an address.
56+
* The gateway only accepts specific alpha-2 values.
57+
*
58+
* @link https://developers.braintreepayments.com/reference/general/countries/php#list-of-countries
59+
*/
60+
private const COUNTRY_CODE = 'countryCodeAlpha2';
61+
62+
/**
63+
* The extended address information—such as apartment or suite number. 255 character maximum.
64+
*/
65+
private const EXTENDED_ADDRESS = 'extendedAddress';
66+
67+
/**
68+
* The locality/city. 255 character maximum.
69+
*/
70+
private const LOCALITY = 'locality';
71+
72+
/**
73+
* The state or province. For PayPal addresses, the region must be a 2-letter abbreviation;
74+
*/
75+
private const REGION = 'region';
76+
77+
/**
78+
* @param SubjectReader $subjectReader
79+
*/
80+
public function __construct(SubjectReader $subjectReader)
81+
{
82+
$this->subjectReader = $subjectReader;
83+
}
84+
85+
/**
86+
* @inheritdoc
87+
*/
88+
public function build(array $buildSubject)
89+
{
90+
$paymentDO = $this->subjectReader->readPayment($buildSubject);
91+
92+
$result = [];
93+
$order = $paymentDO->getOrder();
94+
95+
$billingAddress = $order->getBillingAddress();
96+
if ($billingAddress) {
97+
$result[self::BILLING_ADDRESS] = [
98+
self::REGION => $billingAddress->getRegionCode(),
99+
self::POSTAL_CODE => $billingAddress->getPostcode(),
100+
self::COUNTRY_CODE => $billingAddress->getCountryId(),
101+
self::FIRST_NAME => $billingAddress->getFirstname(),
102+
self::STREET_ADDRESS => $billingAddress->getStreetLine1(),
103+
self::LAST_NAME => $billingAddress->getLastname(),
104+
self::COMPANY => $billingAddress->getCompany(),
105+
self::EXTENDED_ADDRESS => $billingAddress->getStreetLine2(),
106+
self::LOCALITY => $billingAddress->getCity()
107+
];
108+
}
109+
110+
return $result;
111+
}
112+
}

app/code/Magento/Braintree/Test/Unit/Gateway/Validator/ErrorCodeProviderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ public function getErrorCodeDataProvider(): array
7474
'errors' => [],
7575
'transaction' => [
7676
'status' => 'processor_declined',
77-
'processorResponseCode' => '1000'
77+
'processorResponseCode' => '2059'
7878
],
79-
'expectedResult' => ['1000']
79+
'expectedResult' => ['2059']
8080
],
8181
[
8282
'errors' => [

app/code/Magento/Braintree/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
"magento/module-sales": "*",
2323
"magento/module-ui": "*",
2424
"magento/module-vault": "*",
25-
"magento/module-multishipping": "*"
25+
"magento/module-multishipping": "*",
26+
"magento/module-theme": "*"
2627
},
2728
"suggest": {
28-
"magento/module-checkout-agreements": "*",
29-
"magento/module-theme": "*"
29+
"magento/module-checkout-agreements": "*"
3030
},
3131
"type": "magento2-module",
3232
"license": [

app/code/Magento/Braintree/etc/braintree_error_mapping.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<message code="81723" translate="true">Cardholder name is too long.</message>
2222
<message code="81736" translate="true">CVV verification failed.</message>
2323
<message code="cvv" translate="true">CVV verification failed.</message>
24+
<message code="2059" translate="true">Address Verification Failed.</message>
2425
<message code="81737" translate="true">Postal code verification failed.</message>
2526
<message code="81750" translate="true">Credit card number is prohibited.</message>
2627
<message code="81801" translate="true">Addresses must have at least one field filled in.</message>

0 commit comments

Comments
 (0)