<?php
/*
 * Copyright Magmodules.eu. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile
/**
 * @var Base $block
 * @see Base
 */

use Mollie\Payment\Block\Info\Base;

$specificInfo = $block->getSpecificInformation();
$title = $block->escapeHtml($block->getMethod()->getTitle());
?>
<dl class="payment-method">
    <dt class="title">
        <?= /* @noEscape */
        $title; ?>
    </dt>
    <?php if ($url = $block->getPaymentLink()): ?>
        <dt>
            <?= $block->escapeHtml($url, ['a', 'strong']); ?>
        </dt>
    <?php endif; ?>
    <?php if ($specificInfo): ?>
        <dd class="content">
            <table class="data table">
                <caption class="table-caption"><?= /* @noEscape */
                    $title; ?></caption>
                <?php foreach ($specificInfo as $label => $value): ?>
                    <tr>
                        <th scope="row"><?= $block->escapeHtml($label) ?></th>
                        <td>
                            <?= /* @noEscape */
                            nl2br($block->escapeHtml(implode("\n", $block->getValueAsArray($value, true)))); ?>
                        </td>
                    </tr>
                <?php endforeach; ?>
            </table>
        </dd>
    <?php endif; ?>
</dl>
<?= $block->getChildHtml() ?>
