<?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>
 */

// @codingStandardsIgnoreFile

?>
<?php
$_info = $this->getInfo();
?>

<dl class="payment-method adyen_hpp">
    <?php if (!empty($block->getBankTransferData())) : ?>
        <?php
        $banktranferData = $block->getBankTransferData();
        $order = $block->getOrder();
        ?>

        <dt><?php echo $block->escapeHtml(__('Pay using Bank transfer')); ?></dt>
        <dd><?php echo $block->escapeHtml(__('Please transfer the amount using the reference below to the following bank account')); ?></dd>

        <?php if (!empty($order->getGrandTotal())) : ?>
            <dt><?php echo $block->escapeHtml(__('Amount')); ?></dt>
            <dd><?php echo $order->formatPrice($order->getGrandTotal()); ?></dd>
        <?php endif; ?>

        <?php if (!empty($banktranferData['bankTransfer.reference'])) : ?>
            <dt><?php echo $block->escapeHtml(__('With reference')); ?></dt>
            <dd><?php echo $banktranferData['bankTransfer.reference'] ?></dd>
        <?php endif; ?>

        <?php if (!empty($banktranferData['bankTransfer.owner'])) : ?>
            <dt><?php echo $block->escapeHtml(__('Beneficiary Name')); ?></dt>
            <dd><?php echo $banktranferData['bankTransfer.owner'] ?></dd>
        <?php endif; ?>

        <?php if (!empty($banktranferData['bankTransfer.bankName'])) : ?>
            <dt><?php echo $block->escapeHtml(__('Bank')); ?></dt>
            <dd><?php echo $banktranferData['bankTransfer.bankName'] ?></dd>
        <?php endif; ?>

        <?php if (!empty($banktranferData['bankTransfer.iban'])) : ?>
            <dt><?php echo $block->escapeHtml(__('IBAN')); ?></dt>
            <dd><?php echo $banktranferData['bankTransfer.iban'] ?></dd>
        <?php endif; ?>

        <?php if (!empty($banktranferData['bankTransfer.accountCode'])) : ?>
            <dt><?php echo $block->escapeHtml(__('Bankaccount')); ?></dt>
            <dd><?php echo $banktranferData['bankTransfer.accountCode'] ?></dd>
        <?php endif; ?>
    <?php elseif (!empty($block->getMultibancoData())) : ?>
        <?php
        $multibancoData = $block->getMultibancoData();
        ?>

        <dt><?php echo $block->escapeHtml(__('Pay using Multibanco')); ?></dt>
        <dd><?php echo $block->escapeHtml(__('Please pay with the provided Multibanco reference and entity before payment deadline in order to complete our payment')); ?></dd>

        <?php if (!empty($multibancoData['comprafacil.entity'])) : ?>
            <dt><?php echo $block->escapeHtml(__('Entity')); ?></dt>
            <dd><?php echo $multibancoData['comprafacil.entity'] ?></dd>
        <?php endif; ?>

        <?php if (!empty($multibancoData['comprafacil.reference'])) : ?>
            <dt><?php echo $block->escapeHtml(__('Reference')); ?></dt>
            <dd><?php echo $multibancoData['comprafacil.reference'] ?></dd>
        <?php endif; ?>

        <?php if (!empty($multibancoData['comprafacil.amount'])) : ?>
            <dt><?php echo $block->escapeHtml(__('Amount')); ?></dt>
            <dd><?php echo $multibancoData['comprafacil.amount'] ?></dd>
        <?php endif; ?>

        <?php if (!empty($multibancoData['comprafacil.deadline'])) : ?>
            <dt><?php echo $block->escapeHtml(__('Deadline')); ?></dt>
            <dd><?php echo $multibancoData['comprafacil.deadline'] ?> <?php echo $block->escapeHtml(__('Days')); ?></dd>
        <?php endif; ?>
    <?php else: ?>
        <?php if ($_methodTitle = $_info->getAdditionalInformation('method_title')): ?>
            <dt class="title"><?php echo $_methodTitle; ?></dt>
        <?php elseif ($_brandCode = $_info->getAdditionalInformation('brand_code')): ?>
            <dt class="title"><?php echo $_brandCode; ?></dt>
        <?php endif; ?>
    <?php endif; ?>
</dl>
