Skip to content

Commit 6a8edac

Browse files
author
Vitaliy Boyko
committed
graphQl-309: merge remote
2 parents 7305a43 + d82262c commit 6a8edac

File tree

971 files changed

+27453
-5685
lines changed

Some content is hidden

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

971 files changed

+27453
-5685
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4335,7 +4335,7 @@ Tests:
43354335
* Fixed order placing with virtual product using Express Checkout
43364336
* Fixed the error during order placement with Recurring profile payment
43374337
* Fixed wrong redirect after customer registration during multishipping checkout
4338-
* Fixed inability to crate shipping labels
4338+
* Fixed inability to create shipping labels
43394339
* Fixed inability to switch language, if the default language is English
43404340
* Fixed an issue with incorrect XML appearing in cache after some actions on the frontend
43414341
* Fixed product export

app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_block.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<block class="Magento\Backend\Block\Widget\Grid" name="adminhtml.notification.container.grid" as="grid">
1212
<arguments>
1313
<argument name="id" xsi:type="string">notificationGrid</argument>
14-
<argument name="dataSource" xsi:type="object">Magento\AdminNotification\Model\ResourceModel\Grid\Collection</argument>
14+
<argument name="dataSource" xsi:type="object" shared="false">Magento\AdminNotification\Model\ResourceModel\Grid\Collection</argument>
1515
<argument name="default_dir" xsi:type="string">DESC</argument>
1616
<argument name="default_sort" xsi:type="string">date_added</argument>
1717
<argument name="save_parameters_in_session" xsi:type="string">1</argument>

app/code/Magento/AdvancedSearch/view/adminhtml/layout/catalog_search_block.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<block class="Magento\AdvancedSearch\Block\Adminhtml\Search\Grid" name="search.edit.grid" as="grid">
1212
<arguments>
1313
<argument name="id" xsi:type="string">catalog_search_grid</argument>
14-
<argument name="dataSource" xsi:type="object">Magento\AdvancedSearch\Model\ResourceModel\Search\Grid\Collection</argument>
14+
<argument name="dataSource" xsi:type="object" shared="false">Magento\AdvancedSearch\Model\ResourceModel\Search\Grid\Collection</argument>
1515
<argument name="default_sort" xsi:type="string">name</argument>
1616
<argument name="default_dir" xsi:type="string">ASC</argument>
1717
<argument name="save_parameters_in_session" xsi:type="string">1</argument>

app/code/Magento/Authorization/Model/Role.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,29 @@ public function __construct(
5151
}
5252

5353
/**
54-
* {@inheritdoc}
54+
* @inheritDoc
55+
*
56+
* @SuppressWarnings(PHPMD.SerializationAware)
57+
* @deprecated Do not use PHP serialization.
5558
*/
5659
public function __sleep()
5760
{
61+
trigger_error('Using PHP serialization is deprecated', E_USER_DEPRECATED);
62+
5863
$properties = parent::__sleep();
5964
return array_diff($properties, ['_resource', '_resourceCollection']);
6065
}
6166

6267
/**
63-
* {@inheritdoc}
68+
* @inheritDoc
69+
*
70+
* @SuppressWarnings(PHPMD.SerializationAware)
71+
* @deprecated Do not use PHP serialization.
6472
*/
6573
public function __wakeup()
6674
{
75+
trigger_error('Using PHP serialization is deprecated', E_USER_DEPRECATED);
76+
6777
parent::__wakeup();
6878
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
6979
$this->_resource = $objectManager->get(\Magento\Authorization\Model\ResourceModel\Role::class);

app/code/Magento/AuthorizenetAcceptjs/Gateway/Validator/TransactionResponseValidator.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ public function validate(array $validationSubject): ResultInterface
5454
if (isset($transactionResponse['messages']['message']['code'])) {
5555
$errorCodes[] = $transactionResponse['messages']['message']['code'];
5656
$errorMessages[] = $transactionResponse['messages']['message']['text'];
57-
} elseif ($transactionResponse['messages']['message']) {
57+
} elseif (isset($transactionResponse['messages']['message'])) {
5858
foreach ($transactionResponse['messages']['message'] as $message) {
5959
$errorCodes[] = $message['code'];
6060
$errorMessages[] = $message['description'];
6161
}
6262
} elseif (isset($transactionResponse['errors'])) {
6363
foreach ($transactionResponse['errors'] as $message) {
6464
$errorCodes[] = $message['errorCode'];
65-
$errorMessages[] = $message['errorCode'];
65+
$errorMessages[] = $message['errorText'];
6666
}
6767
}
6868

@@ -85,8 +85,10 @@ private function isResponseCodeAnError(array $transactionResponse): bool
8585
?? $transactionResponse['errors'][0]['errorCode']
8686
?? null;
8787

88-
return in_array($transactionResponse['responseCode'], [self::RESPONSE_CODE_APPROVED, self::RESPONSE_CODE_HELD])
89-
&& $code
88+
return !in_array($transactionResponse['responseCode'], [
89+
self::RESPONSE_CODE_APPROVED, self::RESPONSE_CODE_HELD
90+
])
91+
|| $code
9092
&& !in_array(
9193
$code,
9294
[

app/code/Magento/AuthorizenetAcceptjs/Test/Unit/Gateway/Validator/TransactionResponseValidatorTest.php

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@
1515
use PHPUnit\Framework\MockObject\MockObject;
1616
use PHPUnit\Framework\TestCase;
1717

18+
/**
19+
* Tests for the transaction response validator
20+
*/
1821
class TransactionResponseValidatorTest extends TestCase
1922
{
2023
private const RESPONSE_CODE_APPROVED = 1;
2124
private const RESPONSE_CODE_HELD = 4;
25+
private const RESPONSE_CODE_DENIED = 2;
2226
private const RESPONSE_REASON_CODE_APPROVED = 1;
2327
private const RESPONSE_REASON_CODE_PENDING_REVIEW_AUTHORIZED = 252;
2428
private const RESPONSE_REASON_CODE_PENDING_REVIEW = 253;
29+
private const ERROR_CODE_AVS_MISMATCH = 27;
2530

2631
/**
2732
* @var ResultInterfaceFactory|MockObject
@@ -86,16 +91,6 @@ public function testValidateScenarios($transactionResponse, $isValid, $errorCode
8691
public function scenarioProvider()
8792
{
8893
return [
89-
// This validator only cares about successful edge cases so test for default behavior
90-
[
91-
[
92-
'responseCode' => 'foo',
93-
],
94-
true,
95-
[],
96-
[]
97-
],
98-
9994
// Test for acceptable reason codes
10095
[
10196
[
@@ -208,6 +203,29 @@ public function scenarioProvider()
208203
['foo'],
209204
['bar']
210205
],
206+
[
207+
[
208+
'responseCode' => self::RESPONSE_CODE_DENIED,
209+
'errors' => [
210+
[
211+
'errorCode' => self::ERROR_CODE_AVS_MISMATCH,
212+
'errorText' => 'bar'
213+
]
214+
]
215+
],
216+
false,
217+
[self::ERROR_CODE_AVS_MISMATCH],
218+
['bar']
219+
],
220+
// This validator only cares about successful edge cases so test for default behavior
221+
[
222+
[
223+
'responseCode' => 'foo',
224+
],
225+
false,
226+
[],
227+
[]
228+
],
211229
];
212230
}
213231
}

0 commit comments

Comments
 (0)