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

/**
 * @see \Magento\Paypal\Block\Adminhtml\System\Config\ApiWizard
 * @var \Magento\Paypal\Block\Adminhtml\System\Config\ApiWizard $block
 * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
 */
?>
<div class="pp-buttons-container">
    <div id="paypal_api_config" dir="ltr" trbidi="on">
        <?php $scriptString = <<<script
            (function(d, s, id){
                var js, ref = d.getElementsByTagName(s)[0];
                if (!d.getElementById(id)){
                    js = d.createElement(s); js.id = id; js.async = true;
                    js.src = "https://www.paypal.com/webapps/merchantboarding/js/lib/lightbox/partner.js";
                    ref.parentNode.insertBefore(js, ref); }
            }(document, "script", "paypal-js"));
script;
        ?>
        <?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>

        <a class="action-default"
           data-paypal-button="true"
           href="<?= /* @noEscape */ $block->escapeUrl($block->getButtonUrl() . '?' . $block->getQuery()) ?>"
           target="PPFrame"><?= $block->escapeHtml($block->getButtonLabel()) ?></a>

        <a class="action-default"
           data-paypal-button="true"
           href="<?= /* @noEscape */ $block->escapeUrl($block->getSandboxButtonUrl(). '?' . $block->getQuery()) ?>"
           target="PPFrame"><?= $block->escapeHtml($block->getSandboxButtonLabel()) ?></a>
    </div>
</div>
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag("text-align: left;", 'div#paypal_api_config') ?>
