Skip to content

Commit 4602b16

Browse files
[Magento Community Engineering] Community Contributions - 2.4-develop
- merged latest code from mainline branch
2 parents d6a73f9 + 9d76e2b commit 4602b16

File tree

40 files changed

+184
-1106
lines changed

40 files changed

+184
-1106
lines changed

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,6 @@ public function getData(array $data): array
4949
__('Required parameter "authorizenet_acceptjs" for "payment_method" is missing.')
5050
);
5151
}
52-
if (!isset($data[self::PATH_ADDITIONAL_DATA]['opaque_data_descriptor'])) {
53-
throw new GraphQlInputException(
54-
__('Required parameter "opaque_data_descriptor" for "authorizenet_acceptjs" is missing.')
55-
);
56-
}
57-
if (!isset($data[self::PATH_ADDITIONAL_DATA]['opaque_data_value'])) {
58-
throw new GraphQlInputException(
59-
__('Required parameter "opaque_data_value" for "authorizenet_acceptjs" is missing.')
60-
);
61-
}
62-
if (!isset($data[self::PATH_ADDITIONAL_DATA]['cc_last_4'])) {
63-
throw new GraphQlInputException(
64-
__('Required parameter "cc_last_4" for "authorizenet_acceptjs" is missing.')
65-
);
66-
}
6752

6853
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $data);
6954
foreach ($additionalData as $key => $value) {

app/code/Magento/BraintreeGraphQl/Model/BraintreeDataProvider.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,6 @@ public function getData(array $args): array
3131
__('Required parameter "braintree" for "payment_method" is missing.')
3232
);
3333
}
34-
35-
if (!isset($args[self::PATH_ADDITIONAL_DATA]['payment_method_nonce'])) {
36-
throw new GraphQlInputException(
37-
__('Required parameter "payment_method_nonce" for "braintree" is missing.')
38-
);
39-
}
40-
41-
if (!isset($args[self::PATH_ADDITIONAL_DATA]['is_active_payment_token_enabler'])) {
42-
throw new GraphQlInputException(
43-
__('Required parameter "is_active_payment_token_enabler" for "braintree" is missing.')
44-
);
45-
}
46-
4734
return $args[self::PATH_ADDITIONAL_DATA];
4835
}
4936
}

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<actionGroup ref="logout" stepKey="logout"/>
2828
</after>
2929
<!-- Generate the datetime default value -->
30-
<generateDate date="now" format="m/j/y g:i A" stepKey="generateDefaultValue"/>
30+
<generateDate date="now" format="n/j/y g:i A" stepKey="generateDefaultValue"/>
3131
<!-- Create new datetime product attribute -->
3232
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/>
3333
<waitForPageLoad stepKey="waitForPageLoadAttributes"/>

app/code/Magento/CatalogGraphQl/etc/graphql/di.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,10 @@
176176
</argument>
177177
</arguments>
178178
</type>
179+
180+
<type name="Magento\Catalog\Helper\Data">
181+
<arguments>
182+
<argument name="templateFilterModel" xsi:type="string">Magento\Widget\Model\Template\FilterEmulate</argument>
183+
</arguments>
184+
</type>
179185
</config>

app/code/Magento/Sales/Block/Order/History.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,14 @@ public function getBackUrl()
188188
{
189189
return $this->getUrl('customer/account/');
190190
}
191+
192+
/**
193+
* Get message for no orders.
194+
*
195+
* @return \Magento\Framework\Phrase
196+
*/
197+
public function getEmptyOrdersMessage()
198+
{
199+
return __('You have placed no orders.');
200+
}
191201
}

app/code/Magento/Sales/view/frontend/templates/order/history.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@
5959
<div class="order-products-toolbar toolbar bottom"><?= $block->getPagerHtml() ?></div>
6060
<?php endif ?>
6161
<?php else : ?>
62-
<div class="message info empty"><span><?= $block->escapeHtml(__('You have placed no orders.')) ?></span></div>
62+
<div class="message info empty"><span><?= $block->escapeHtml($block->getEmptyOrdersMessage()) ?></span></div>
6363
<?php endif ?>

app/code/Magento/Theme/view/frontend/templates/html/pager.phtml

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,33 @@
1010
* @see \Magento\Theme\Block\Html\Pager
1111
*/
1212
?>
13-
<?php if ($block->getCollection()->getSize()) : ?>
13+
<?php if ($block->getCollection()->getSize()): ?>
1414

15-
<?php if ($block->getUseContainer()) : ?>
15+
<?php if ($block->getUseContainer()): ?>
1616
<div class="pager">
1717
<?php endif ?>
1818

19-
<?php if ($block->getShowAmounts()) : ?>
19+
<?php if ($block->getShowAmounts()): ?>
2020
<p class="toolbar-amount">
2121
<span class="toolbar-number">
22-
<?php if ($block->getLastPageNum()>1) : ?>
23-
<?= $block->escapeHtml(__('Items %1 to %2 of %3 total', $block->getFirstNum(), $block->getLastNum(), $block->getTotalNum())) ?>
24-
<?php elseif ($block->getTotalNum() == 1) : ?>
22+
<?php if ($block->getLastPageNum()>1): ?>
23+
<?= $block->escapeHtml(
24+
__('Items %1 to %2 of %3 total', $block->getFirstNum(), $block->getLastNum(), $block->getTotalNum())
25+
) ?>
26+
<?php elseif ($block->getTotalNum() == 1): ?>
2527
<?= $block->escapeHtml(__('%1 Item', $block->getTotalNum())) ?>
26-
<?php else : ?>
28+
<?php else: ?>
2729
<?= $block->escapeHtml(__('%1 Item(s)', $block->getTotalNum())) ?>
2830
<?php endif; ?>
2931
</span>
3032
</p>
3133
<?php endif ?>
3234

33-
<?php if ($block->getLastPageNum()>1) : ?>
35+
<?php if ($block->getLastPageNum()>1): ?>
3436
<div class="pages">
3537
<strong class="label pages-label" id="paging-label"><?= $block->escapeHtml(__('Page')) ?></strong>
3638
<ul class="items pages-items" aria-labelledby="paging-label">
37-
<?php if (!$block->isFirstPage()) : ?>
39+
<?php if (!$block->isFirstPage()): ?>
3840
<li class="item pages-item-previous">
3941
<?php $text = $block->getAnchorTextForPrevious() ? $block->getAnchorTextForPrevious() : '';?>
4042
<a class="<?= $block->escapeHtmlAttr($text ? 'link ' : 'action ') ?> previous"
@@ -46,7 +48,7 @@
4648
</li>
4749
<?php endif;?>
4850

49-
<?php if ($block->canShowFirst()) : ?>
51+
<?php if ($block->canShowFirst()): ?>
5052
<li class="item">
5153
<a class="page first" href="<?= $block->escapeUrl($block->getFirstPageUrl()) ?>">
5254
<span class="label"><?= $block->escapeHtml(__('Page')) ?></span>
@@ -55,7 +57,7 @@
5557
</li>
5658
<?php endif;?>
5759

58-
<?php if ($block->canShowPreviousJump()) : ?>
60+
<?php if ($block->canShowPreviousJump()): ?>
5961
<li class="item">
6062
<a class="page previous jump"
6163
title=""
@@ -65,15 +67,15 @@
6567
</li>
6668
<?php endif;?>
6769

68-
<?php foreach ($block->getFramePages() as $_page) : ?>
69-
<?php if ($block->isPageCurrent($_page)) : ?>
70+
<?php foreach ($block->getFramePages() as $_page): ?>
71+
<?php if ($block->isPageCurrent($_page)): ?>
7072
<li class="item current">
7173
<strong class="page">
7274
<span class="label"><?= $block->escapeHtml(__('You\'re currently reading page')) ?></span>
7375
<span><?= $block->escapeHtml($_page) ?></span>
7476
</strong>
7577
</li>
76-
<?php else : ?>
78+
<?php else: ?>
7779
<li class="item">
7880
<a href="<?= $block->escapeUrl($block->getPageUrl($_page)) ?>" class="page">
7981
<span class="label"><?= $block->escapeHtml(__('Page')) ?></span>
@@ -83,15 +85,15 @@
8385
<?php endif;?>
8486
<?php endforeach;?>
8587

86-
<?php if ($block->canShowNextJump()) : ?>
88+
<?php if ($block->canShowNextJump()): ?>
8789
<li class="item">
8890
<a class="page next jump" title="" href="<?= $block->escapeUrl($block->getNextJumpUrl()) ?>">
8991
<span>...</span>
9092
</a>
9193
</li>
9294
<?php endif;?>
9395

94-
<?php if ($block->canShowLast()) : ?>
96+
<?php if ($block->canShowLast()): ?>
9597
<li class="item">
9698
<a class="page last" href="<?= $block->escapeUrl($block->getLastPageUrl()) ?>">
9799
<span class="label"><?= $block->escapeHtml(__('Page')) ?></span>
@@ -100,7 +102,7 @@
100102
</li>
101103
<?php endif;?>
102104

103-
<?php if (!$block->isLastPage()) : ?>
105+
<?php if (!$block->isLastPage()): ?>
104106
<li class="item pages-item-next">
105107
<?php $text = $block->getAnchorTextForNext() ? $block->getAnchorTextForNext() : '';?>
106108
<a class="<?= /* @noEscape */ $text ? 'link ' : 'action ' ?> next"
@@ -115,13 +117,13 @@
115117
</div>
116118
<?php endif; ?>
117119

118-
<?php if ($block->isShowPerPage()) : ?>
120+
<?php if ($block->isShowPerPage()): ?>
119121
<div class="limiter">
120122
<strong class="limiter-label"><?= $block->escapeHtml(__('Show')) ?></strong>
121123
<select id="limiter" data-mage-init='{"redirectUrl": {"event":"change"}}' class="limiter-options">
122-
<?php foreach ($block->getAvailableLimit() as $_key => $_limit) : ?>
123-
<option value="<?= $block->escapeHtmlAttr($block->getLimitUrl($_key)) ?>"
124-
<?php if ($block->isLimitCurrent($_key)) : ?>
124+
<?php foreach ($block->getAvailableLimit() as $_key => $_limit): ?>
125+
<option value="<?= $block->escapeUrl($block->getLimitUrl($_key)) ?>"
126+
<?php if ($block->isLimitCurrent($_key)): ?>
125127
selected="selected"<?php endif ?>>
126128
<?= $block->escapeHtml($_limit) ?>
127129
</option>
@@ -131,7 +133,7 @@
131133
</div>
132134
<?php endif ?>
133135

134-
<?php if ($block->getUseContainer()) : ?>
136+
<?php if ($block->getUseContainer()): ?>
135137
</div>
136138
<?php endif ?>
137139

dev/tests/api-functional/testsuite/Magento/GraphQl/AuthorizenetAcceptjs/Customer/SetPaymentMethodTest.php

Lines changed: 1 addition & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -157,38 +157,7 @@ function (string $maskedQuoteId) {
157157
[
158158
'Required parameter "authorizenet_acceptjs" for "payment_method" is missing.'
159159
]
160-
],
161-
[
162-
function (string $maskedQuoteId) {
163-
return $this->getEmptyAcceptJsInput($maskedQuoteId);
164-
},
165-
[
166-
'Field AuthorizenetInput.cc_last_4 of required type Int! was not provided.',
167-
'Field AuthorizenetInput.opaque_data_descriptor of required type String! was not provided.',
168-
'Field AuthorizenetInput.opaque_data_value of required type String! was not provided.'
169-
]
170-
171-
],
172-
[
173-
function (string $maskedQuoteId) {
174-
return $this->getMissingCcLastFourAcceptJsInput(
175-
$maskedQuoteId,
176-
static::VALID_DESCRIPTOR,
177-
static::VALID_NONCE
178-
);
179-
},
180-
[
181-
'Field AuthorizenetInput.cc_last_4 of required type Int! was not provided',
182-
]
183-
],
184-
[
185-
function (string $maskedQuoteId) {
186-
return $this->getMissingOpaqueDataValueAcceptJsInput($maskedQuoteId, static::VALID_DESCRIPTOR);
187-
},
188-
[
189-
'Field AuthorizenetInput.opaque_data_value of required type String! was not provided',
190-
]
191-
],
160+
]
192161
];
193162
}
194163

@@ -218,93 +187,6 @@ private function getInvalidSetPaymentMutation(string $maskedQuoteId): string
218187
QUERY;
219188
}
220189

221-
/**
222-
* Get setPaymentMethodOnCart missing required additional data properties
223-
*
224-
* @param string $maskedQuoteId
225-
* @return string
226-
*/
227-
private function getEmptyAcceptJsInput(string $maskedQuoteId): string
228-
{
229-
return <<<QUERY
230-
mutation {
231-
setPaymentMethodOnCart(input:{
232-
cart_id:"{$maskedQuoteId}"
233-
payment_method:{
234-
code:"authorizenet_acceptjs"
235-
authorizenet_acceptjs: {}
236-
}
237-
}) {
238-
cart {
239-
selected_payment_method {
240-
code
241-
}
242-
}
243-
}
244-
}
245-
QUERY;
246-
}
247-
248-
/**
249-
* Get setPaymentMethodOnCart missing required additional data properties
250-
*
251-
* @param string $maskedQuoteId
252-
* @return string
253-
*/
254-
private function getMissingCcLastFourAcceptJsInput(string $maskedQuoteId, string $descriptor, string $nonce): string
255-
{
256-
return <<<QUERY
257-
mutation {
258-
setPaymentMethodOnCart(input:{
259-
cart_id:"{$maskedQuoteId}"
260-
payment_method:{
261-
code:"authorizenet_acceptjs"
262-
authorizenet_acceptjs:{
263-
opaque_data_descriptor: "{$descriptor}"
264-
opaque_data_value: "{$nonce}"
265-
}
266-
}
267-
}) {
268-
cart {
269-
selected_payment_method {
270-
code
271-
}
272-
}
273-
}
274-
}
275-
QUERY;
276-
}
277-
278-
/**
279-
* Get setPaymentMethodOnCart missing required additional data properties
280-
*
281-
* @param string $maskedQuoteId
282-
* @return string
283-
*/
284-
private function getMissingOpaqueDataValueAcceptJsInput(string $maskedQuoteId, string $descriptor): string
285-
{
286-
return <<<QUERY
287-
mutation {
288-
setPaymentMethodOnCart(input:{
289-
cart_id:"{$maskedQuoteId}"
290-
payment_method:{
291-
code:"authorizenet_acceptjs"
292-
authorizenet_acceptjs:{
293-
opaque_data_descriptor: "{$descriptor}"
294-
cc_last_4: 1111
295-
}
296-
}
297-
}) {
298-
cart {
299-
selected_payment_method {
300-
code
301-
}
302-
}
303-
}
304-
}
305-
QUERY;
306-
}
307-
308190
private function assertPlaceOrderResponse(array $response, string $reservedOrderId): void
309191
{
310192
self::assertArrayHasKey('placeOrder', $response);

0 commit comments

Comments
 (0)