简体   繁体   中英

Braintree custom paypal button

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM