<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/**
 * @var \Magento\Braintree\Block\Paypal\Button $block
 */

$id = $block->getContainerId() . random_int(0, PHP_INT_MAX);

$config = [
    'Magento_Braintree/js/paypal/button_shopping_cart' => [
        'id' => $id,
        'clientToken' => $block->getClientToken(),
        'displayName' => $block->getMerchantName(),
        'actionSuccess' => $block->getActionSuccess(),
        'environment' => $block->getEnvironment()
    ]
];

?>
<div data-mage-init='<?= /* @noEscape */ json_encode($config); ?>'
    class="paypal checkout paypal-logo braintree-paypal-logo<?= /* @noEscape */ $block->getContainerId(); ?>-container">
    <div data-currency="<?= /* @noEscape */ $block->getCurrency(); ?>"
       data-locale="<?= /* @noEscape */ $block->getLocale(); ?>"
       data-amount="<?= /* @noEscape */ $block->getAmount(); ?>"
       id="<?= /* @noEscape */ $id; ?>"
       class="action-braintree-paypal-logo">
    </div>
</div>
