Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Commit 8a135c0

Browse files
committed
Merge branch '2.3-develop' of https://github.com/magento/magento2ce into PR-2019-12-10
2 parents d1f2aca + f2af84c commit 8a135c0

File tree

92 files changed

+4427
-1568
lines changed

Some content is hidden

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

92 files changed

+4427
-1568
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/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>

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

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

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -270,35 +270,6 @@ public function testSetPaymentMethodInvalidMethodInput(string $methodCode)
270270
$this->graphQlMutation($setPaymentQuery, [], '', $this->getHeaderMap());
271271
}
272272

273-
/**
274-
* @magentoConfigFixture default_store carriers/flatrate/active 1
275-
* @magentoConfigFixture default_store payment/braintree/active 1
276-
* @magentoConfigFixture default_store payment/braintree_cc_vault/active 1
277-
* @magentoConfigFixture default_store payment/braintree/environment sandbox
278-
* @magentoConfigFixture default_store payment/braintree/merchant_id def_merchant_id
279-
* @magentoConfigFixture default_store payment/braintree/public_key def_public_key
280-
* @magentoConfigFixture default_store payment/braintree/private_key def_private_key
281-
* @magentoApiDataFixture Magento/Customer/_files/customer.php
282-
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
283-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
284-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
285-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
286-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
287-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php
288-
* @expectedException \Exception
289-
*/
290-
public function testSetPaymentMethodWithoutRequiredPaymentMethodInput()
291-
{
292-
$reservedOrderId = 'test_quote';
293-
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
294-
295-
$setPaymentQuery = $this->getSetPaymentBraintreeQueryInvalidPaymentMethodInput($maskedQuoteId);
296-
$this->expectExceptionMessage(
297-
'Field BraintreeInput.is_active_payment_token_enabler of required type Boolean! was not provided.'
298-
);
299-
$this->graphQlMutation($setPaymentQuery, [], '', $this->getHeaderMap());
300-
}
301-
302273
public function dataProviderTestSetPaymentMethodInvalidInput(): array
303274
{
304275
return [
@@ -409,33 +380,6 @@ private function getSetPaymentBraintreeQueryInvalidInput(string $maskedQuoteId,
409380
QUERY;
410381
}
411382

412-
/**
413-
* @param string $maskedQuoteId
414-
* @return string
415-
*/
416-
private function getSetPaymentBraintreeQueryInvalidPaymentMethodInput(string $maskedQuoteId): string
417-
{
418-
return <<<QUERY
419-
mutation {
420-
setPaymentMethodOnCart(input:{
421-
cart_id:"{$maskedQuoteId}"
422-
payment_method:{
423-
code:"braintree"
424-
braintree:{
425-
payment_method_nonce:"fake-valid-nonce"
426-
}
427-
}
428-
}) {
429-
cart {
430-
selected_payment_method {
431-
code
432-
}
433-
}
434-
}
435-
}
436-
QUERY;
437-
}
438-
439383
/**
440384
* @param string $maskedQuoteId
441385
* @param string $methodCode

dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -129,39 +129,6 @@ public function testSetPaymentMethodInvalidInput()
129129
$this->graphQlMutation($setPaymentQuery);
130130
}
131131

132-
/**
133-
* @magentoConfigFixture default_store carriers/flatrate/active 1
134-
* @magentoConfigFixture default_store payment/braintree/active 1
135-
* @magentoConfigFixture default_store payment/braintree/environment sandbox
136-
* @magentoConfigFixture default_store payment/braintree/merchant_id def_merchant_id
137-
* @magentoConfigFixture default_store payment/braintree/public_key def_public_key
138-
* @magentoConfigFixture default_store payment/braintree/private_key def_private_key
139-
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
140-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
141-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php
142-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
143-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
144-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
145-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php
146-
* @expectedException \Exception
147-
*/
148-
public function testSetPaymentMethodInvalidMethodInput()
149-
{
150-
$reservedOrderId = 'test_quote';
151-
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
152-
153-
$setPaymentQuery = $this->getSetPaymentBraintreeQueryInvalidMethodInput($maskedQuoteId);
154-
155-
$this->expectExceptionMessage(
156-
'Field BraintreeInput.is_active_payment_token_enabler of required type Boolean! was not provided'
157-
);
158-
$this->expectExceptionMessage(
159-
'Field BraintreeInput.payment_method_nonce of required type String! was not provided.'
160-
);
161-
162-
$this->graphQlMutation($setPaymentQuery);
163-
}
164-
165132
private function assertPlaceOrderResponse(array $response, string $reservedOrderId): void
166133
{
167134
self::assertArrayHasKey('placeOrder', $response);
@@ -231,31 +198,6 @@ private function getSetPaymentBraintreeQueryInvalidInput(string $maskedQuoteId):
231198
QUERY;
232199
}
233200

234-
/**
235-
* @param string $maskedQuoteId
236-
* @return string
237-
*/
238-
private function getSetPaymentBraintreeQueryInvalidMethodInput(string $maskedQuoteId): string
239-
{
240-
return <<<QUERY
241-
mutation {
242-
setPaymentMethodOnCart(input:{
243-
cart_id:"{$maskedQuoteId}"
244-
payment_method:{
245-
code:"braintree"
246-
braintree: {}
247-
}
248-
}) {
249-
cart {
250-
selected_payment_method {
251-
code
252-
}
253-
}
254-
}
255-
}
256-
QUERY;
257-
}
258-
259201
/**
260202
* @param string $maskedQuoteId
261203
* @return string

0 commit comments

Comments
 (0)