Skip to content

Commit 1cde991

Browse files
committed
magento/graphql-ce#1061: Remove redundant logic from resolvers
1 parent 7cb2f43 commit 1cde991

File tree

4 files changed

+0
-80
lines changed

4 files changed

+0
-80
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
}

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

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -380,33 +380,6 @@ private function getSetPaymentBraintreeQueryInvalidInput(string $maskedQuoteId,
380380
QUERY;
381381
}
382382

383-
/**
384-
* @param string $maskedQuoteId
385-
* @return string
386-
*/
387-
private function getSetPaymentBraintreeQueryInvalidPaymentMethodInput(string $maskedQuoteId): string
388-
{
389-
return <<<QUERY
390-
mutation {
391-
setPaymentMethodOnCart(input:{
392-
cart_id:"{$maskedQuoteId}"
393-
payment_method:{
394-
code:"braintree"
395-
braintree:{
396-
payment_method_nonce:"fake-valid-nonce"
397-
}
398-
}
399-
}) {
400-
cart {
401-
selected_payment_method {
402-
code
403-
}
404-
}
405-
}
406-
}
407-
QUERY;
408-
}
409-
410383
/**
411384
* @param string $maskedQuoteId
412385
* @param string $methodCode

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

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -198,31 +198,6 @@ private function getSetPaymentBraintreeQueryInvalidInput(string $maskedQuoteId):
198198
QUERY;
199199
}
200200

201-
/**
202-
* @param string $maskedQuoteId
203-
* @return string
204-
*/
205-
private function getSetPaymentBraintreeQueryInvalidMethodInput(string $maskedQuoteId): string
206-
{
207-
return <<<QUERY
208-
mutation {
209-
setPaymentMethodOnCart(input:{
210-
cart_id:"{$maskedQuoteId}"
211-
payment_method:{
212-
code:"braintree"
213-
braintree: {}
214-
}
215-
}) {
216-
cart {
217-
selected_payment_method {
218-
code
219-
}
220-
}
221-
}
222-
}
223-
QUERY;
224-
}
225-
226201
/**
227202
* @param string $maskedQuoteId
228203
* @return string

0 commit comments

Comments
 (0)