joost
joost

Reputation: 173

How to implement a custom PayPal button with Braintree JS SDK v3

According to this SO post: Braintree custom paypal button it's possible to use a custom button to start the PayPal payment process. However: the only documentation that I can find regards JS SDK v2 and they've progressed to v3.

The changelog at https://github.com/braintree/braintree-web/blob/master/CHANGELOG.md#300-beta1 specifically states Developers have the option to customize the PayPal button that is displayed on their page. We provide only a bindable programmatic handler.

How can I use an existing button to start the payment with v3 of the SDK?

Upvotes: 1

Views: 3389

Answers (1)

cooljake
cooljake

Reputation: 696

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.

Since version 3.16.0 of Braintree's Javascript SDK, the original PayPal component has been deprecated in favor of the new "PayPal Checkout" component, developed by PayPal. This new component was developed entirely by PayPal, and it provides several advantages over the integration that Braintree had been using in the old component. That old component had the ability to use entirely custom PayPal buttons, but the new "PayPal Checkout" component does not. However, it does offer considerable flexibility in the button's appearance.

In PayPal's documentation for the "PayPal Checkout" component you can find instructions on how to customize the PayPal button. PayPal's documentation will show you how to do things like change the shape, the colors, and the label used.

You can try out the different stylings using the Braintree checkout playground. This runs an instance of the Braintree checkout using PayPal's "PayPal Checkout" component. The example on the left side of the page updates automatically as you change the code on the right side.

Upvotes: 3

Related Questions