I am using the BrainTree.js for PCI compliance, and the tutorial I am using here:
https://www.braintreepayments.com/docs/javascript
There recommendation is to call the form by the ID like so:
var braintree = Braintree.create("YourClientSideEncryptionKey");
braintree.onSubmitEncryptForm('braintree-payment-form');
I'm using AngularJS with the form being inside a controller. So inputs such as name, card, etc are tied to a scope using ng-model:
<div class="form-group">
<label>Card Number</label>
<input type="text" class="form-control" name="number" ng-model="card.number" />
</div>
My question is how can I submit a form using AngularJS and BrainTree.js in a manner that uses the data collected using ng-model?
Example:
braintree.onSubmitEncryptForm({name: $scope.card.name, card: $scope.card.number});