Cordova braintree插件

Cordova braintree插件,cordova,braintree,Cordova,Braintree,我正在尝试将“braintree”支付插件集成到我的cordova应用程序中。我能够成功初始化braintree插件。但我无法获得付款页面的UI // Initializing... this is working fine var token = "xxcssf..."; BraintreePlugin.initialize(token, function () { console.log("init OK!"); }, function (error) { console

我正在尝试将“braintree”支付插件集成到我的cordova应用程序中。我能够成功初始化braintree插件。但我无法获得付款页面的UI

// Initializing... this is working fine

var token = "xxcssf...";

BraintreePlugin.initialize(token,
    function () { console.log("init OK!"); },
    function (error) { console.error(error); 
});     

// Calling the payment method... not able to execute this code... not getting issues too

var options = {
    amount: "49.99",
    primaryDescription: "Your Item"
};

BraintreePlugin.presentDropInPaymentUI(options, function (result) {
    if (result.userCancelled) {
        console.debug("User cancelled payment dialog.");
    } else {
        console.info("User completed payment dialog.");
        console.info("Payment Nonce: " + result.nonce);
        console.debug("Payment Result.", result);
    }
});

提前感谢

这对我来说很有用:

  • 把这个放在头标签里面:

    <script src="https://js.braintreegateway.com/web/dropin/1.4.0/js/dropin.min.js"></script>
    
    
    
  • 添加此标记,仅结束body标记:

    <div id="payment-form"></div>  
    
    
    
  • 在控制器中调用braintreeService和$window

  • 现在一切都应该开始了


    祝你好运

    你在使用哪个插件?考虑到这一点,你可能会更幸运地接触到插件的开发者。此外,如果您在调用
    #presentDropInPaymentUI
    时使用特定错误或一些日志更新您的问题,这将非常有帮助。