<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/**
 * @var \Magento\Payment\Block\Adminhtml\Transparent\Form $block
 * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
 */
$code = $block->escapeHtml($block->getMethodCode());
$ccType = $block->getInfoData('cc_type');
$ccExpMonth = $block->getInfoData('cc_exp_month');
$ccExpYear = $block->getInfoData('cc_exp_year');
?>
<fieldset class="admin__fieldset payment-method" id="payment_form_<?= /* @noEscape */ $code ?>">
    <div class="field-type admin__field _required">
        <label class="admin__field-label" for="<?= /* @noEscape */ $code ?>_cc_type">
            <span><?= $block->escapeHtml(__('Credit Card Type')) ?></span>
        </label>
        <div class="admin__field-control">
            <select id="<?= /* @noEscape */ $code ?>_cc_type" name="payment[cc_type]"
                    class="required-entry validate-cc-type-select admin__control-select">
                <option value=""></option>
                <?php foreach ($block->getCcAvailableTypes() as $typeCode => $typeName): ?>
                    <option value="<?= $block->escapeHtml($typeCode) ?>"
                            <?php if ($typeCode == $ccType): ?>selected="selected"<?php endif ?>>
                        <?= $block->escapeHtml($typeName) ?>
                    </option>
                <?php endforeach ?>
            </select>
        </div>
    </div>
    <div class="field-number admin__field _required">
        <label class="admin__field-label" for="<?= /* @noEscape */ $code ?>_cc_number">
            <span><?= $block->escapeHtml(__('Credit Card Number')) ?></span>
        </label>
        <div class="admin__field-control">
            <input type="text" id="<?= /* @noEscape */ $code ?>_cc_number" name="payment[cc_number]"
                   title="<?= $block->escapeHtml(__('Credit Card Number')) ?>"
                   class="admin__control-text validate-cc-number"
                   value="<?= /* @noEscape */ $block->getInfoData('cc_number') ?>"/>
        </div>
    </div>
    <div class="field-date admin__field _required">
        <label class="admin__field-label" for="<?= /* @noEscape */ $code ?>_expiration">
            <span><?= $block->escapeHtml(__('Expiration Date')) ?></span>
        </label>
        <div class="admin__field-control">
            <select id="<?= /* @noEscape */ $code ?>_expiration" name="payment[cc_exp_month]"
                    class="admin__control-select admin__control-select-month validate-cc-exp required-entry">
                <?php foreach ($block->getCcMonths() as $k => $v): ?>
                    <option value="<?= $block->escapeHtml($k) ?>"
                            <?php if ($k == $ccExpMonth): ?>selected="selected"<?php endif ?>>
                        <?= $block->escapeHtml($v) ?>
                    </option>
                <?php endforeach; ?>
            </select>
            <select id="<?= /* @noEscape */ $code ?>_expiration_yr" name="payment[cc_exp_year]"
                    class="admin__control-select admin__control-select-year required-entry">
                <?php foreach ($block->getCcYears() as $k => $v): ?>
                    <option value="<?= /* @noEscape */ $k ? $block->escapeHtml($k) : '' ?>"
                            <?php if ($k == $ccExpYear): ?>selected="selected"<?php endif ?>>
                        <?= $block->escapeHtml($v) ?>
                    </option>
                <?php endforeach ?>
            </select>
        </div>
    </div>

    <?php if ($block->hasVerification()): ?>
        <div class="field-number required admin__field _required">
            <label class="admin__field-label" for="<?= /* @noEscape */ $code ?>_cc_cid">
                <span><?= $block->escapeHtml(__('Card Verification Number')) ?></span>
            </label>
            <div class="admin__field-control">
                <input type="text" title="<?= $block->escapeHtml(__('Card Verification Number')) ?>"
                       class="required-entry validate-cc-cvn admin__control-cvn admin__control-text"
                       id="<?= /* @noEscape */ $code ?>_cc_cid"
                       name="payment[cc_cid]" value="<?= /* @noEscape */ $block->getInfoData('cc_cid') ?>"/>
            </div>
        </div>
    <?php endif; ?>
</fieldset>
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
    "display:none",
    'fieldset#payment_form_' . /* @noEscape */ $code
) ?>
