braintree-angular
------- FORKED -------
Reasons:
forked to allow custom integeration to set client token and remove deprecated .success() function
Example Usage:
Module
var name = module.exports = 'app.module';
angular
.module(name, [])
.value('braintreeToken', require('./braintree.value.js'))
Value
var braintreeValue = {
token: ''
};
module.exports = braintreeValue;
Controller
function startup(){
$braintree.getClientToken().then(function(token){
client = new $braintree.api.Client({
clientToken: token
});
}).catch(function(error){
console.log(error);
});
}
A module for using braintree-web in your Angular app.
Disclaimer:
braintree-angular
is not an official Braintree module.
Install
npm install braintree-angular
bower install braintree-angular
Run the example
git clone git@github.com:jeffcarp/braintree-angular.gitcd braintree-angularnpm installnpm run example# Open localhost:8000/dropin.html
Setup
For all integrations, first declare a clientTokenPath
constant to tell Braintree where to fetch your client token.
var yourApp = angular ;
Client tokens are generated with your Braintree server library. Here are guides on how to set up the server library and how to generate a client token.
Currently supported integrations:
Drop-in UI
Buy some things
angular ;
PayPal Standalone Button
Advanced Integration (tokenization)
angular ;
The full set of options you can pass to client.tokenizeCard
are available in the Braintree docs. Please be advised that using the advanced integration method widens your PCI compliance scope from SAQ A to SAQ A-EP.