Skip to content

Commit 0ea4bc1

Browse files
committed
magento graphql-ce#493 GraphQl-299 Do not rely on global state in resolvers
1 parent 2f796b1 commit 0ea4bc1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/code/Magento/PaypalGraphQl/Model/Resolver/PayflowProResponse.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ public function resolve(
117117
}
118118

119119
$maskedCartId = $args['input']['cart_id'];
120-
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId());
120+
$storeId = (int)$context->getExtensionAttributes()->getStore()->getId();
121+
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
121122

122123
$paypalPayload = $args['input']['paypal_payload'] ?? '';
123124

app/code/Magento/PaypalGraphQl/Model/Resolver/PayflowProToken.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public function resolve(
6565
$urls = $args['input']['urls'] ?? null ;
6666

6767
$customerId = $context->getUserId();
68-
$cart = $this->getCartForUser->execute($cartId, $customerId);
68+
$storeId = (int)$context->getExtensionAttributes()->getStore()->getId();
69+
$cart = $this->getCartForUser->execute($cartId, $customerId, $storeId);
6970

7071
if (!empty($args['input']['urls'])) {
7172
$this->validateUrls($args['input']['urls']);

0 commit comments

Comments
 (0)