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 PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何替换eregi() 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
