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

Commit 61f3425

Browse files
committed
update integartion for new schema
1 parent e0b4468 commit 61f3425

11 files changed

+261
-295
lines changed

dev/tests/integration/testsuite/Magento/AuthorizenetGraphQl/Model/Resolver/Customer/PlaceOrderWithAuthorizeNetTest.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -89,29 +89,29 @@ public function testDispatchToPlaceOrderWithRegisteredCustomer(): void
8989
$cartId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
9090
$query
9191
= <<<QUERY
92-
mutation {
92+
mutation {
9393
setPaymentMethodOnCart(input: {
94-
cart_id: "$cartId"
95-
payment_method: {
96-
code: "$paymentMethod"
97-
additional_data:
98-
{authorizenet_acceptjs:
99-
{opaque_data_descriptor: "mydescriptor",
100-
opaque_data_value: "myvalue",
101-
cc_last_4: 1111}}
94+
cart_id: "$cartId",
95+
payment_method: {
96+
code: "$paymentMethod",
97+
authorizenet_acceptjs: {
98+
opaque_data_descriptor: "COMMON.ACCEPT.INAPP.PAYMENT",
99+
opaque_data_value: "fake-nonce",
100+
cc_last_4: 1111
102101
}
103-
}) {
104-
cart {
105-
selected_payment_method {
106-
code
102+
}
103+
}) {
104+
cart {
105+
selected_payment_method {
106+
code
107107
}
108108
}
109109
}
110-
placeOrder(input: {cart_id: "$cartId"}) {
111-
order {
112-
order_id
113-
}
110+
placeOrder(input: {cart_id: "$cartId"}) {
111+
order {
112+
order_id
114113
}
114+
}
115115
}
116116
QUERY;
117117

dev/tests/integration/testsuite/Magento/AuthorizenetGraphQl/Model/Resolver/Customer/SetAuthorizeNetPaymentMethodOnCartTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@ public function testDispatchToSetPaymentMethodWithAuthorizenet(): void
6464
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
6565
$query
6666
= <<<QUERY
67-
mutation {
67+
mutation {
6868
setPaymentMethodOnCart(input: {
69-
cart_id: "$maskedQuoteId"
70-
payment_method: {
71-
code: "$methodCode"
72-
additional_data:
73-
{authorizenet_acceptjs:
74-
{opaque_data_descriptor: "COMMON.ACCEPT.INAPP.PAYMENT",
75-
opaque_data_value: "abx",
76-
cc_last_4: 1111}}
69+
cart_id: "$maskedQuoteId",
70+
payment_method: {
71+
code: "$methodCode",
72+
authorizenet_acceptjs: {
73+
opaque_data_descriptor: "COMMON.ACCEPT.INAPP.PAYMENT",
74+
opaque_data_value: "abx",
75+
cc_last_4: 1111
7776
}
78-
}) {
77+
}
78+
}) {
7979
cart {
8080
selected_payment_method {
8181
code

dev/tests/integration/testsuite/Magento/AuthorizenetGraphQl/Model/Resolver/Guest/PlaceOrderWithAuthorizeNetTest.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -89,29 +89,29 @@ public function testDispatchToPlaceAnOrderWithAuthorizenet(): void
8989
$cartId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
9090
$query
9191
= <<<QUERY
92-
mutation {
92+
mutation {
9393
setPaymentMethodOnCart(input: {
94-
cart_id: "$cartId"
95-
payment_method: {
96-
code: "$paymentMethod"
97-
additional_data:
98-
{authorizenet_acceptjs:
99-
{opaque_data_descriptor: "mydescriptor",
100-
opaque_data_value: "myvalue",
101-
cc_last_4: 1111}}
94+
cart_id: "$cartId",
95+
payment_method: {
96+
code: "$paymentMethod",
97+
authorizenet_acceptjs: {
98+
opaque_data_descriptor: "COMMON.ACCEPT.INAPP.PAYMENT",
99+
opaque_data_value: "fake-nonce",
100+
cc_last_4: 1111
102101
}
103-
}) {
104-
cart {
105-
selected_payment_method {
106-
code
102+
}
103+
}) {
104+
cart {
105+
selected_payment_method {
106+
code
107107
}
108108
}
109109
}
110-
placeOrder(input: {cart_id: "$cartId"}) {
111-
order {
112-
order_id
113-
}
110+
placeOrder(input: {cart_id: "$cartId"}) {
111+
order {
112+
order_id
114113
}
114+
}
115115
}
116116
QUERY;
117117

dev/tests/integration/testsuite/Magento/AuthorizenetGraphQl/Model/Resolver/Guest/SetAuthorizeNetPaymentMethodOnCartTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ public function testDispatchToSetPaymentMethodWithAuthorizenet(): void
5959
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
6060
$query
6161
= <<<QUERY
62-
mutation {
62+
mutation {
6363
setPaymentMethodOnCart(input: {
64-
cart_id: "$maskedQuoteId"
65-
payment_method: {
66-
code: "$methodCode"
67-
additional_data:
68-
{authorizenet_acceptjs:
69-
{opaque_data_descriptor: "COMMON.ACCEPT.INAPP.PAYMENT",
70-
opaque_data_value: "abx",
71-
cc_last_4: 1111}}
64+
cart_id: "$maskedQuoteId",
65+
payment_method: {
66+
code: "$methodCode",
67+
authorizenet_acceptjs: {
68+
opaque_data_descriptor: "COMMON.ACCEPT.INAPP.PAYMENT",
69+
opaque_data_value: "abx",
70+
cc_last_4: 1111
7271
}
73-
}) {
72+
}
73+
}) {
7474
cart {
7575
selected_payment_method {
7676
code

dev/tests/integration/testsuite/Magento/PaypalGraphQl/Model/Resolver/Customer/PaypalExpressSetPaymentMethodTest.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,13 @@ public function testResolve(string $paymentMethod): void
9898
setPaymentMethodOnCart(input: {
9999
payment_method: {
100100
code: "{$paymentMethod}",
101-
additional_data: {
102-
paypal_express: {
103-
payer_id: "$payerId",
104-
token: "$token"
105-
}
106-
payflow_express: {
107-
payer_id: "$payerId",
108-
token: "$token"
109-
}
101+
paypal_express: {
102+
payer_id: "$payerId",
103+
token: "$token"
104+
}
105+
payflow_express: {
106+
payer_id: "$payerId",
107+
token: "$token"
110108
}
111109
},
112110
cart_id: "{$maskedCartId}"})

dev/tests/integration/testsuite/Magento/PaypalGraphQl/Model/Resolver/Customer/PlaceOrderWithPayflowLinkTest.php

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,31 +119,28 @@ public function testResolvePlaceOrderWithPayflowLinkForCustomer(): void
119119

120120
$query
121121
= <<<QUERY
122-
mutation {
122+
mutation {
123123
setPaymentMethodOnCart(input: {
124-
cart_id: "$cartId"
125-
payment_method: {
126-
code: "$paymentMethod"
127-
additional_data: {
128-
payflow_link:
129-
{
130-
cancel_url:"{$baseUrl}paypal/payflow/cancelPayment"
131-
return_url:"{$baseUrl}paypal/payflow/returnUrl"
132-
}
133-
}
124+
cart_id: "$cartId",
125+
payment_method: {
126+
code: "$paymentMethod",
127+
payflow_link: {
128+
cancel_url: "{$baseUrl}paypal/payflow/cancelPayment",
129+
return_url: "{$baseUrl}paypal/payflow/returnUrl"
134130
}
135-
}) {
136-
cart {
137-
selected_payment_method {
138-
code
131+
}
132+
}) {
133+
cart {
134+
selected_payment_method {
135+
code
139136
}
140137
}
141138
}
142-
placeOrder(input: {cart_id: "$cartId"}) {
143-
order {
144-
order_id
145-
}
139+
placeOrder(input: {cart_id: "$cartId"}) {
140+
order {
141+
order_id
146142
}
143+
}
147144
}
148145
QUERY;
149146

dev/tests/integration/testsuite/Magento/PaypalGraphQl/Model/Resolver/Customer/PlaceOrderWithPayflowProTest.php

Lines changed: 42 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -77,60 +77,52 @@ public function testResolveCustomer(): void
7777

7878
$query = <<<QUERY
7979
mutation {
80-
setPaymentMethodOnCart(input: {
81-
payment_method: {
82-
code: "{$paymentMethod}",
83-
additional_data: {
84-
payflowpro: {
85-
cc_details: {
86-
cc_exp_month: 12,
87-
cc_exp_year: 2030,
88-
cc_last_4: 1111,
89-
cc_type: "IV",
90-
}
91-
}
92-
}
93-
},
94-
cart_id: "{$cartId}"})
95-
{
96-
cart {
97-
selected_payment_method {
98-
code
99-
}
80+
setPaymentMethodOnCart(input: {
81+
payment_method: {
82+
code: "{$paymentMethod}",
83+
payflowpro: {
84+
cc_details: {
85+
cc_exp_month: 12,
86+
cc_exp_year: 2030,
87+
cc_last_4: 1111,
88+
cc_type: "IV"
10089
}
10190
}
102-
createPayflowProToken(
103-
input: {
104-
cart_id:"{$cartId}",
105-
urls: {
106-
cancel_url: "{$baseUrl}paypal/transparent/cancel/"
107-
error_url: "{$baseUrl}paypal/transparent/error/"
108-
return_url: "{$baseUrl}paypal/transparent/response/"
109-
}
110-
}
111-
) {
112-
response_message
113-
result
114-
result_code
115-
secure_token
116-
secure_token_id
117-
}
118-
handlePayflowProResponse(input: {
119-
paypal_payload: "$payload",
120-
cart_id: "{$cartId}"
121-
})
122-
{
123-
cart {
124-
selected_payment_method {
125-
code
126-
}
127-
}
91+
},
92+
cart_id: "{$cartId}"
93+
}) {
94+
cart {
95+
selected_payment_method {
96+
code
12897
}
129-
placeOrder(input: {cart_id: "{$cartId}"}) {
130-
order {
131-
order_id
132-
}
98+
}
99+
}
100+
createPayflowProToken(input: {
101+
cart_id: "{$cartId}",
102+
urls: {
103+
cancel_url: "{$baseUrl}paypal/transparent/cancel/",
104+
error_url: "{$baseUrl}paypal/transparent/error/",
105+
return_url: "{$baseUrl}paypal/transparent/response/"
106+
}
107+
}) {
108+
response_message
109+
result
110+
result_code
111+
secure_token
112+
secure_token_id
113+
}
114+
handlePayflowProResponse(input: {paypal_payload: "$payload", cart_id: "{$cartId}"}) {
115+
cart {
116+
selected_payment_method {
117+
code
133118
}
119+
}
120+
}
121+
placeOrder(input: {cart_id: "{$cartId}"}) {
122+
order {
123+
order_id
124+
}
125+
}
134126
}
135127
QUERY;
136128

0 commit comments

Comments
 (0)