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

Commit

Permalink
Get storeId from resolver context
Browse files Browse the repository at this point in the history
  • Loading branch information
pmclain committed Jul 30, 2019
1 parent e49df5b commit 169ac1b
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
*/
class CreateBraintreeClientToken implements ResolverInterface
{
/**
* @var StoreManagerInterface
*/
private $storeManager;

/**
* @var Config
*/
Expand All @@ -37,16 +32,13 @@ class CreateBraintreeClientToken implements ResolverInterface
private $adapterFactory;

/**
* @param StoreManagerInterface $storeManager
* @param Config $config
* @param BraintreeAdapterFactory $adapterFactory
*/
public function __construct(
StoreManagerInterface $storeManager,
Config $config,
BraintreeAdapterFactory $adapterFactory
) {
$this->storeManager = $storeManager;
$this->config = $config;
$this->adapterFactory = $adapterFactory;
}
Expand All @@ -61,7 +53,7 @@ public function resolve(
array $value = null,
array $args = null
) {
$storeId = $this->storeManager->getStore()->getId();
$storeId = (int)$context->getExtensionAttributes()->getStore()->getId();

if (!$this->config->isActive($storeId)) {
throw new GraphQlInputException(__('The Braintree payment method is not active.'));
Expand Down

0 comments on commit 169ac1b

Please sign in to comment.