<?php
/**
 * @author      Open Source Team
 * @copyright   2022 Pagar.me (https://pagar.me)
 * @license     https://pagar.me Copyright
 *
 * @link        https://pagar.me
 */

/** @var \Woocommerce\Pagarme\Block\Checkout\Form\Billet $this */

declare( strict_types=1 );

if (!function_exists('add_action')) {
    exit(0);
}
?>
<fieldset class="wc-credit-card-form wc-payment-form">
    <?php if ($this->showOrderValue()) : ?>
        <p class="form-row form-row-wide">
            <label for="<?= $this->getElementId('order-value') ?>">
                <?php esc_html_e('Value (Boleto)', 'woo-pagarme-payments'); ?>
                <span class="required">*</span>
            </label>
            <input type="text" id="<?= $this->getElementId('order-value') ?>"
                   name="<?= $this->getElementId('order-value') ?>" data-element="order-value"
                   data-pagarme-element="order-value" data-mask="#0,00" data-mask-reverse="true"
                   data-value="1" data-required="true"
                   data-pagarmecheckout-order-value-method="<?= $this->getPaymentInstance()->getMethodCode() ?>"
                   class="input-text">
        </p>
    <?php endif; ?>
    <?= $this->getMessage(true) ?>
    <?= $this->getImage(true) ?>
    <?php if ($this->showMulticustomersForm()) : ?>
        <?= $this->createBlock(
            '\Woocommerce\Pagarme\Block\Checkout\Field\EnableMulticustomers',
            'pagarme.checkout.field.multicustomers',
            [
                'payment_instance' => $this->getPaymentInstance(),
                'parent_element_id' => $this->getElementId('multicustomers'),
                'sequence' => $this->getMulticustomersSequece()
            ]
        )->toHtml() ?>
        <?= $this->createBlock(
            '\Woocommerce\Pagarme\Block\Checkout\Form\Multicustomers',
            'pagarme.checkout.form.multicustomers',
            [
                'payment_instance' => $this->getPaymentInstance(),
                'parent_element_id' => $this->getElementId('multicustomers'),
                'sequence' => $this->getMulticustomersSequece()
            ]
        )->toHtml() ?>
    <?php endif; ?>
</fieldset>
