我正在尝试使用Atmosphere软件包(https://atmospherejs.com/mrgalaxy/stripe)将条带集成到我的meteor应用程序中,我无法弄清楚为什么我会收到此错误。这就是我现在所拥有的:
Repo克隆到包/条带
流星列表返回 - mrgalaxy:stripe 1.5.6 Stripe.js和Node-Stripe被带到Meteor。
当我试图运行'meteor add stripe'时,我收到'条纹:没有这样的包',所以我按照它在Atmosphere上说的方式添加它。 (meteor add mrgalaxy:stripe)。
当我检查它时,看起来包的JS文件已加载到浏览器中,但我仍然收到此错误,这使我相信我没有正确包含该包。有什么想法吗?如果需要任何其他调试信息,我很乐意提供。提前谢谢!
Main.js
'click #submit-btn': function() {
Stripe.setPublishableKey('PUBLISHABLE_KEY');
var Stripe = StripeAPI('SECRET_KEY');
Stripe.charges.create({
amount: 10,
currency: "USD",
card: {
number: "4242424242424242",
exp_month: "03",
exp_year: "2014"
}
}, function (err, res) {
console.log(err, res);
return false;
});
}
答案 0 :(得分:3)
仅限Stripe.setPublishableKey(' YOUR_PUBLISHABLE_KEY');可以在客户端。
click事件应该在运行其余代码的服务器上执行Meteor.call到Meteor.method。