Braintree custom paypal button(Braintree 自定义贝宝按钮)
问题描述
我想为付款方式创建一个下拉列表.
I would like to create a drop-down list for payment methods.
例如:
<ul>
<li id="paypal">paypal</li>
<li id="credit_card">credit card</li>
</ul>
在选择的信用卡上,它会加载信用卡付款所需的所有字段.但是现在我在设置贝宝按钮时遇到了麻烦.我真的不想要一个蓝色按钮.我可以让用户点击 id="paypal" 并启动 paypal 吗?
On select credit card, it loads all fields needed for credit card payment. But now I am having trouble setting up a paypal button. I don't really want a blue button. Can I have the user click id="paypal" and launch paypal?
braintree.setup(token,"custom",{
paypal:{
container:"paypal",
amount: 10.00,
currency: 'USD'
}
})
我可以让它完全自定义吗?我希望贝宝按钮看起来像我的 CSS 列表中的一个项目.
Can I make it completely custom looking? I want the paypal button just look like an item in the list with my CSS.
推荐答案
Braintree 员工在这里.从 2.15.0 开始,我们引入了headless"选项,允许自定义贝宝按钮.
Braintree employee here. As of 2.15.0, we introduced a "headless" option that allows a custom PayPal button.
这项工作在这些 JS 网址上进行:
https://js.braintreegateway.com/js/braintree-2.15.2.js
https://js.braintreegateway.com/js/braintree-2.15.2.min.js
This work is live at these JS urls:
https://js.braintreegateway.com/js/braintree-2.15.2.js
https://js.braintreegateway.com/js/braintree-2.15.2.min.js
我们创建了一个提供示例代码的小要点.此版本尚未热链接,但我们的文档会在更新时更新.
We created a small gist that provides sample code. This version is not yet hotlinked but our docs will be updated when it is.
这篇关于Braintree 自定义贝宝按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Braintree 自定义贝宝按钮


- PHP - if 语句中的倒序 2021-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- PHP foreach() 与数组中的数组? 2022-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01