button.phtml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * @var \Magento\Braintree\Block\Paypal\Button $block
  8. */
  9. $id = $block->getContainerId() . mt_rand();
  10. $config = [
  11. 'Magento_Braintree/js/paypal/button' => [
  12. 'id' => $id,
  13. 'clientToken' => $block->getClientToken(),
  14. 'displayName' => $block->getMerchantName(),
  15. 'actionSuccess' => $block->getActionSuccess()
  16. ]
  17. ];
  18. ?>
  19. <div data-mage-init='<?= /* @noEscape */ json_encode($config) ?>'
  20. class="paypal checkout paypal-logo braintree-paypal-logo<?= /* @noEscape */ $block->getContainerId() ?>-container">
  21. <button data-currency="<?= /* @noEscape */ $block->getCurrency() ?>"
  22. data-locale="<?= /* @noEscape */ $block->getLocale() ?>"
  23. data-amount="<?= /* @noEscape */ $block->getAmount() ?>"
  24. id="<?= /* @noEscape */ $id ?>"
  25. class="action-braintree-paypal-logo" disabled>
  26. <img class="braintree-paypal-button-hidden"
  27. src="https://checkout.paypal.com/pwpp/2.17.6/images/pay-with-paypal.png"
  28. alt="<?= $block->escapeHtml(__('Pay with PayPal')) ?>"
  29. title="<?= $block->escapeHtml(__('Pay with PayPal')) ?>"/>
  30. </button>
  31. </div>