Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Payment.php
Go to the documentation of this file.
1 <?php
7 
12 
19 class Payment extends Template
20 {
24  private $config;
25 
33  public function __construct(
34  Context $context,
36  array $data = []
37  ) {
38  parent::__construct($context, $data);
39  $this->config = $config;
40  }
41 
46  public function getPaymentConfig()
47  {
48  $payment = $this->config->getConfig()['payment'];
49  $config = $payment[$this->getCode()];
50  $config['code'] = $this->getCode();
51  $config['clientTokenUrl'] = $this->_urlBuilder->getUrl(
52  'braintree/payment/getClientToken',
53  ['_secure' => true]
54  );
55  return json_encode($config, JSON_UNESCAPED_SLASHES);
56  }
57 
62  public function getCode()
63  {
64  return ConfigProvider::CODE;
65  }
66 }
$config
Definition: fraud_order.php:17
__construct(Context $context, ConfigProviderInterface $config, array $data=[])
Definition: Payment.php:33
$payment
Definition: order.php:17