forked from jeffcarp/braintree-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
38 lines (32 loc) · 952 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var braintreeFactory = require('./braintree-factory');
var braingular = window.angular.module('braintree-angular', []);
braingular.factory('$braintree', braintreeFactory.fullBraintreeFactory);
braingular.directive('braintreeDropin', function() {
return {
restrict: 'AEC',
scope: {
options: '='
},
template: '<div id="bt-dropin"></div>',
controller: ['$scope', '$braintree', function($scope, $braintree) {
var options = $scope.options || {};
options.container = 'bt-dropin';
$braintree.setupDropin(options);
}]
}
});
braingular.directive('braintreePaypal', function() {
return {
restrict: 'AEC',
scope: {
options: '='
},
template: '<div id="bt-paypal"></div>',
controller: function($scope, $braintree) {
var options = $scope.options || {};
options.container = 'bt-paypal';
$braintree.setupPayPal(options);
}
}
});
module.exports = braingular;