Braintree自定义贝宝按钮 [英] Braintree custom paypal button
问题描述
我想为付款方式创建一个下拉列表.
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 开始,我们引入了无头"选项,该选项允许自定义贝宝按钮.
Braintree employee here. As of 2.15.0, we introduced a "headless" option that allows a custom PayPal button.
此工作在以下JS URL上进行:
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自定义贝宝按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!