<?php
/**
 *
 * Adyen Payment module (https://www.adyen.com/)
 *
 * Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
 * See LICENSE.txt for license details.
 *
 * Author: Adyen <magento@adyen.com>
 */

use Magento\Vault\Model\Ui\TokenUiComponentProviderInterface;

// @codingStandardsIgnoreFile
/** @var \Magento\Framework\View\Element\Template $block */
$details = $block->getData(TokenUiComponentProviderInterface::COMPONENT_DETAILS);
$id = $block->escapeHtml($block->getData('id'));
?>
<div data-mage-init='{
        "Adyen_Payment/js/vault": {
            "container": "payment_<?= /* @noEscape */ $id ?>",
            "publicHash": "<?= $block->escapeHtml(
                    $block->getData(TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH)
                    ) ?>",
            "code": "<?= $block->escapeHtml($block->getData('code')) ?>"
        }
    }'
     id="payment_<?= /* @noEscape */ $id ?>"
     class="admin__field">
    <div class="admin__field-control control">
        <input type="radio" id="token_switcher_<?= /* @noEscape */
        $id ?>" name="payment[token_switcher]"/>
        <img src="<?= $block->escapeUrl($details['icon']['url']) ?>"
             width="<?= $block->escapeHtml($details['icon']['width']) ?>"
             height="<?= $block->escapeHtml($details['icon']['height']) ?>"
             class="payment-icon">
        <span><?= $block->escapeHtml(__('ending')) ?></span>
        <span><?= $block->escapeHtml($details['maskedCC']) ?></span>
        (<span><?= $block->escapeHtml(__('expires')) ?></span>:
        <span><?= $block->escapeHtml($details['expirationDate']) ?></span>)
    </div>
</div>
