Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CheckmoConfigProvider.php
Go to the documentation of this file.
1 <?php
7 
10 use Magento\Payment\Helper\Data as PaymentHelper;
11 
13 {
18 
22  protected $method;
23 
27  protected $escaper;
28 
33  public function __construct(
34  PaymentHelper $paymentHelper,
36  ) {
37  $this->escaper = $escaper;
38  $this->method = $paymentHelper->getMethodInstance($this->methodCode);
39  }
40 
44  public function getConfig()
45  {
46  return $this->method->isAvailable() ? [
47  'payment' => [
48  'checkmo' => [
49  'mailingAddress' => $this->getMailingAddress(),
50  'payableTo' => $this->getPayableTo(),
51  ],
52  ],
53  ] : [];
54  }
55 
61  protected function getMailingAddress()
62  {
63  return nl2br($this->escaper->escapeHtml($this->method->getMailingAddress()));
64  }
65 
71  protected function getPayableTo()
72  {
73  return $this->method->getPayableTo();
74  }
75 }
__construct(PaymentHelper $paymentHelper, Escaper $escaper)