33 \
Magento\Payment\Model\Config $paymentConfig,
36 parent::__construct($context,
$data);
37 $this->_paymentConfig = $paymentConfig;
48 $types = $this->_paymentConfig->getCcTypes();
50 $availableTypes =
$method->getConfigData(
'cctypes');
51 if ($availableTypes) {
52 $availableTypes = explode(
',', $availableTypes);
54 if (!in_array(
$code, $availableTypes)) {
70 $months = $this->
getData(
'cc_months');
71 if ($months ===
null) {
72 $months[0] =
__(
'Month');
73 $months = array_merge($months, $this->_paymentConfig->getMonths());
74 $this->
setData(
'cc_months', $months);
86 $years = $this->
getData(
'cc_years');
87 if ($years ===
null) {
88 $years = $this->_paymentConfig->getYears();
89 $years = [0 =>
__(
'Year')] + $years;
90 $this->
setData(
'cc_years', $years);
120 $availableTypes = explode(
',', $this->
getMethod()->getConfigData(
'cctypes'));
121 $ssPresenations = array_intersect([
'SS',
'SM',
'SO'], $availableTypes);
122 if ($availableTypes && count($ssPresenations) > 0) {
141 $years[$year] = $year;
143 $years = [0 =>
__(
'Year')] + $years;
154 $this->_eventManager->dispatch(
'payment_form_block_to_html_before', [
'block' => $this]);
155 return parent::_toHtml();
getData($key='', $index=null)
setData($key, $value=null)
if(!isset($_GET['name'])) $name