【发布时间】:2016-08-15 01:13:24
【问题描述】:
我刚刚迁移到 heroku,当我尝试向客户收费时,我收到了这个错误。
Unhandled rejection Error: Stripe: Unknown arguments ([object Object]). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.
下面是我的云代码
Parse.Cloud.define("charge", function(request, response){
Stripe.charges.create({
amount: 100*100,
currency: "usd",
customer: request.params.customerId,
card: request.params.cardId
},{
success: function(httpResponse) {
response.success("success");
},
error: function(httpResponse) {
response.error(httpResponse)
}
});
});
【问题讨论】:
-
你的所有库都安装了吗。
-
是的,我可以执行其他条带功能,只是充电导致了这个错误。
-
奇数。您确定您的堆栈跟踪表明此代码是问题所在吗?另外,这是您的确切代码,还是您在粘贴到 SO 之前修改了任何内容?
-
2016-08-14T05:22:15.382882+00:00 app[web.1]: Unhandled rejection Error: Stripe: Unknown arguments ([object Object]). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to POST function (outputs) { 2016-08-14T05:22:15.382895+00:00 app[web.1]: return cleanString.replace(/\{([\s\S]+?)\}/g, function($0, $1) { 2016-08-14T05:22:15.382896+00:00 app[web.1]: return encodeURIComponent(outputs[$1] || ''); 2016-08-14T05:22:15.382898+00:00 app[web.1]: }); 2016-08-14T05:22:15.382898+00:00 app[web.1]: }) -
没有修改任何东西