Skip to content

streetlib/braintree-web

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

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', {
  container: '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
});

Packages

No packages published

Languages

  • JavaScript 100.0%