Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
InstructionsConfigProvider.php
Go to the documentation of this file.
1 <?php
7 
10 use Magento\Payment\Helper\Data as PaymentHelper;
11 
13 {
17  protected $methodCodes = [
20  ];
21 
25  protected $methods = [];
26 
30  protected $escaper;
31 
36  public function __construct(
37  PaymentHelper $paymentHelper,
39  ) {
40  $this->escaper = $escaper;
41  foreach ($this->methodCodes as $code) {
42  $this->methods[$code] = $paymentHelper->getMethodInstance($code);
43  }
44  }
45 
49  public function getConfig()
50  {
51  $config = [];
52  foreach ($this->methodCodes as $code) {
53  if ($this->methods[$code]->isAvailable()) {
54  $config['payment']['instructions'][$code] = $this->getInstructions($code);
55  }
56  }
57  return $config;
58  }
59 
66  protected function getInstructions($code)
67  {
68  return nl2br($this->escaper->escapeHtml($this->methods[$code]->getInstructions()));
69  }
70 }
$config
Definition: fraud_order.php:17
__construct(PaymentHelper $paymentHelper, Escaper $escaper)
$code
Definition: info.phtml:12