Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BraintreeAdapterFactory.php
Go to the documentation of this file.
1 <?php
7 
10 
15 {
19  private $objectManager;
20 
24  private $config;
25 
30  public function __construct(ObjectManagerInterface $objectManager, Config $config)
31  {
32  $this->config = $config;
33  $this->objectManager = $objectManager;
34  }
35 
44  public function create($storeId = null)
45  {
46  return $this->objectManager->create(
47  BraintreeAdapter::class,
48  [
49  'merchantId' => $this->config->getMerchantId($storeId),
50  'publicKey' => $this->config->getValue(Config::KEY_PUBLIC_KEY, $storeId),
51  'privateKey' => $this->config->getValue(Config::KEY_PRIVATE_KEY, $storeId),
52  'environment' => $this->config->getEnvironment($storeId),
53  ]
54  );
55  }
56 }
$objectManager
Definition: bootstrap.php:17
$config
Definition: fraud_order.php:17
__construct(ObjectManagerInterface $objectManager, Config $config)