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

// @codingStandardsIgnoreFile

/**
 * @var $block \Adyen\Payment\Block\Info\PayByLink
 * @var $escaper \Magento\Framework\Escaper
 */
if (!isset($escaper)) {
    $escaper = $block;
}
$paymentInfo = $block->getInfo();
?>
<span><?= $escaper->escapeHtml($block->getMethod()->getTitle()); ?></span>
<?php if (!empty($paymentInfo->getAdditionalInformation('payByLinkUrl'))): ?>
    <div>
        <a rel=noopener
           target="_blank"
           href="<?= $escaper->escapeHtml($paymentInfo->getAdditionalInformation('payByLinkUrl')); ?>">
            <?= $escaper->escapeHtml(__('Payment Link')) ?>
        </a>
        <?php if ($paymentMethod = $paymentInfo->getAdditionalInformation('payment_method')): ?>
            <div><?= $block->escapeHtml(__('Payment Method: %1', $paymentMethod)); ?></div>
        <?php endif; ?>
    </div>
<?php endif; ?>
<?= $escaper->escapeHtml($block->getChildHtml()); ?>
