Braintree custom paypal button

戏子无情 提交于 2019-12-01 10:10:01

问题


I would like to create a drop-down list for payment methods.

For example:

<ul>
  <li id="paypal">paypal</li>
  <li id="credit_card">credit card</li>
</ul>

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'
    }
  })

Can I make it completely custom looking? I want the paypal button just look like an item in the list with my CSS.


回答1:


Braintree employee here. As of 2.15.0, we introduced a "headless" option that allows a custom PayPal button.

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.



来源:https://stackoverflow.com/questions/33312407/braintree-custom-paypal-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!