JSPM

braintree-web

2.11.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 356635
  • Score
    100M100P100Q175065F
  • License MIT

A suite of tools for integrating Braintree in the browser

Package Exports

  • braintree-web

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (braintree-web) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

braintree-web

A suite of tools for integrating Braintree in the browser.

This is the repo to submit issues if you have any problems or questions about any v.zero JS integration.

Install

npm install braintree-web
bower install braintree-web

Usage

For more thorough documentation, visit the JS SDK docs.

Drop-in integration

<form action="/your/server/endpoint" method="post">
    <div id="dropin-container"></div>
</form>
braintree.setup('your-client-token', 'dropin', {
  container: 'dropin-container'
});

Custom integration

<form id="payment-form" action="/your/server/endpoint" method="post">
  <input data-braintree-name="number" value="4111111111111111" />
  <input data-braintree-name="expiration_date" value="10/20" />
  <input type="submit" value="Purchase" />
</form>
braintree.setup('your-client-token', 'custom', {
  id: 'payment-form'
});

Advanced integration

var client = new braintree.api.Client({
  clientToken: 'your-client-token'
});

client.tokenizeCard({
  number: '4111111111111111',
  expirationDate: '10/20'
}, function (err, nonce) {
  // Send nonce to your server
});