我正在尝试将Braintree Payments嵌入式嵌入到Ionic移动应用程序中。基于布伦特里文档和一些代码示例我能在网上找到的,下面的代码是什么我已经设法拿出这么远,但它似乎没有工作:Braintree在Ionic中嵌入式容器
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>
我也包括在index.html中的下列行:
<script src="https://js.braintreegateway.com/js/braintree-2.23.0.min.js"></script>
我对Ionic和HTML5/JS开发一般都很陌生,所以任何帮助都会很感激。
似乎已经奏效!感谢您的帮助 – whtvr
感谢您使用cordova白名单插件。这可以使用braintree插件的导入模块吗?或者这是严格使用cordova braintree插件吗? –