I'm trying to integrate a Braintree Payments drop-in into an Ionic mobile app. Based on the Braintree documentation and some code examples i was able to find online, the following code is what I've managed to come up with so far but it doesn't seem to work:
controller.js
.controller('CheckoutForm', function($scope, $window) {
$scope.clientToken = "<token generated by the server>"
$scope.renderCheckout = function() {
braintree.setup($scope.clientToken, "dropin", {
container: "payment-form"
});
}
})
template.html
<div>
Payment details:
<form id="checkout">
<div id="payment-form" onLoad="renderCheckout()"></div>
</form>
</div>
I also included the following line in the index.html:
<script src="https://js.braintreegateway.com/js/braintree-2.23.0.min.js"></script>
I'm quite new to Ionic and HTML5/JS development in general so any help would be much appreciated.