1.42.0 • Published 4 months ago

braintree-web-drop-in v1.42.0

Weekly downloads
38,765
License
MIT
Repository
github
Last release
4 months ago

Braintree Web Drop-in

Build Status Build Status Build Status

npm version

A pre-made payments UI for accepting cards and alternative payments in the browser built using version 3 of the Braintree JS client SDK.

If you have any feedback or questions, create an issue or contact Braintree support.

What's new

  • Updated UI to easily accommodate multiple payment methods
  • Not in an iframe; feel free to style Drop-in to blend in with your website
  • Now available in 23 languages
  • Open source and open development

Getting started

For setup and usage, see our reference.

Full example

This is a full example of a Drop-in integration that only accepts credit cards.

<!DOCTYPE html>
<html lang="en">
 <head>
   <meta charset="utf-8">
   <title>Checkout</title>
 </head>
 <body>
   <div id="dropin-container"></div>
   <button id="submit-button">Purchase</button>

   <script src="https://js.braintreegateway.com/web/dropin/1.42.0/js/dropin.min.js"></script>

   <script>
     var submitButton = document.querySelector('#submit-button');

     braintree.dropin.create({
       authorization: 'CLIENT_AUTHORIZATION',
       selector: '#dropin-container'
     }, function (err, dropinInstance) {
       if (err) {
         // Handle any errors that might've occurred when creating Drop-in
         console.error(err);
         return;
       }
       submitButton.addEventListener('click', function () {
         dropinInstance.requestPaymentMethod(function (err, payload) {
           if (err) {
             // Handle errors in requesting payment method
           }

           // Send payload.nonce to your server
         });
       });
     });
   </script>
 </body>
</html>

Browser support

Drop-in is supported in all browsers supported by the Braintree JavaScript Client SDK.

Customization

The design of Drop-in is intentionally opinionated, and while we aimed to make the design work in many scenarios, the design of your website may conflict with the default design of Drop-in.

For minor UI customizations, review our documentation.

For more substantial changes, you may fork Drop-in, make your desired changes and build the assets by running npm run build. By default, Drop-in uses a hosted version of the built stylesheet. To override this behavior and use a custom stylesheet instead, simply add <link> tag to your page with the id braintree-dropin-stylesheet.

Drop-in uses the Braintree JavaScript SDK. So if a fully customized UI is what you're looking for, Drop-in may be used as a reference implementation for using the JavaScript SDK.

License

Drop-in is open source and available under the MIT license. See the LICENSE file for more info.

1.42.0

4 months ago

1.41.0

5 months ago

1.39.1

9 months ago

1.39.0

10 months ago

1.40.0

9 months ago

1.40.2

9 months ago

1.40.1

9 months ago

1.38.1

11 months ago

1.38.0

11 months ago

1.37.0

12 months ago

1.36.1

1 year ago

1.35.0

1 year ago

1.36.0

1 year ago

1.34.0

1 year ago

1.33.7

1 year ago

1.33.5

1 year ago

1.33.6

1 year ago

1.33.3

2 years ago

1.33.4

2 years ago

1.33.2

2 years ago

1.33.1

2 years ago

1.33.0

2 years ago

1.32.1

2 years ago

1.32.0

3 years ago

1.31.2

3 years ago

1.31.1

3 years ago

1.31.0

3 years ago

1.30.1

3 years ago

1.30.0

3 years ago

1.29.0

3 years ago

1.28.0

3 years ago

1.27.0

3 years ago

1.26.1

3 years ago

1.26.0

3 years ago

1.25.0

4 years ago

1.24.0

4 years ago

1.23.0

4 years ago

1.22.1

4 years ago

1.22.0

4 years ago

1.21.0

4 years ago

1.20.4

5 years ago

1.20.3

5 years ago

1.20.2

5 years ago

1.20.1

5 years ago

1.20.0

5 years ago

1.19.0

5 years ago

1.18.0

5 years ago

1.17.2

5 years ago

1.17.1

5 years ago

1.17.0

5 years ago

1.16.0

5 years ago

1.15.0

5 years ago

1.14.1

5 years ago

1.14.0

6 years ago

1.13.0

6 years ago

1.12.0

6 years ago

1.11.0

6 years ago

1.10.0

6 years ago

1.9.4

6 years ago

1.9.3

6 years ago

1.9.2

6 years ago

1.9.1

6 years ago

1.9.0

6 years ago

1.8.1

7 years ago

1.8.0

7 years ago

1.7.0

7 years ago

1.6.1

7 years ago

1.6.0

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

1.0.0-beta.7

7 years ago

1.0.0-beta.6

7 years ago

1.0.0-beta.5

7 years ago