|
Apache/2.4.41 (Ubuntu) Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) server ip : 62.171.164.128 | your ip : 127.0.0.1 safemode OFF > / home / dev2.destoffenstraat.com / app / code / Acx / StorePickup / Model / |
Filename | /home/dev2.destoffenstraat.com/app/code/Acx/StorePickup/Model/StorePickupConfigProvider.php |
Size | 1.49 kb |
Permission | rwxrwxrwx |
Owner | root : root |
Create time | 17-Aug-2025 10:26 |
Last modified | 06-Apr-2021 18:06 |
Last accessed | 21-Aug-2025 22:38 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
namespace Acx\StorePickup\Model;
use Magento\Checkout\Model\ConfigProviderInterface;
use Magento\Framework\Escaper;
use Magento\Payment\Helper\Data as PaymentHelper;
class StorePickupConfigProvider implements ConfigProviderInterface
{
/**
* @var string[]
*/
private $methodCodes = [
Payment::PAYMENT_METHOD_IN_STORE_PICKUP_MULTI_CODE
];
/**
* @var \Magento\Payment\Model\Method\AbstractMethod[]
*/
private $methods = [];
/**
* @var Escaper
*/
private $escaper;
/**
* @param PaymentHelper $paymentHelper
* @param Escaper $escaper
*/
public function __construct(
PaymentHelper $paymentHelper,
Escaper $escaper
) {
$this->escaper = $escaper;
foreach ($this->methodCodes as $code) {
$this->methods[$code] = $paymentHelper->getMethodInstance($code);
}
}
/**
* {@inheritdoc}
*/
public function getConfig()
{
$config = [];
foreach ($this->methodCodes as $code) {
$config['payment']['instructions'][$code] = $this->getInstructions($code);
}
return $config;
}
/**
* Get instructions text from config
*
* @param string $code
* @return string
*/
protected function getInstructions($code)
{
return nl2br($this->escaper->escapeHtml($this->methods[$code]->getInstructions()));
}
}
namespace Acx\StorePickup\Model;
use Magento\Checkout\Model\ConfigProviderInterface;
use Magento\Framework\Escaper;
use Magento\Payment\Helper\Data as PaymentHelper;
class StorePickupConfigProvider implements ConfigProviderInterface
{
/**
* @var string[]
*/
private $methodCodes = [
Payment::PAYMENT_METHOD_IN_STORE_PICKUP_MULTI_CODE
];
/**
* @var \Magento\Payment\Model\Method\AbstractMethod[]
*/
private $methods = [];
/**
* @var Escaper
*/
private $escaper;
/**
* @param PaymentHelper $paymentHelper
* @param Escaper $escaper
*/
public function __construct(
PaymentHelper $paymentHelper,
Escaper $escaper
) {
$this->escaper = $escaper;
foreach ($this->methodCodes as $code) {
$this->methods[$code] = $paymentHelper->getMethodInstance($code);
}
}
/**
* {@inheritdoc}
*/
public function getConfig()
{
$config = [];
foreach ($this->methodCodes as $code) {
$config['payment']['instructions'][$code] = $this->getInstructions($code);
}
return $config;
}
/**
* Get instructions text from config
*
* @param string $code
* @return string
*/
protected function getInstructions($code)
{
return nl2br($this->escaper->escapeHtml($this->methods[$code]->getInstructions()));
}
}