2016-08-14 151 views
0

我剛剛遷移到了heroku,當我嘗試向客戶收費時,出現此錯誤。遷移到heroku後,Stripe停止工作

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) 
    } 
}); 
}); 
+0

你已經安裝了所有的庫。 –

+0

是的,我可以執行其他條紋功能,它只是充電給我這個錯誤。 – anonymous

+0

奇數。你確定你的堆棧跟蹤表明這個代碼是問題嗎?另外,這是你的確切代碼,還是你在粘貼到SO之前修改了任何東西? –

回答

0

的問題是,你在解析雲代碼不再因此你不再有機會獲得解析的條紋庫。現在你正在使用真正的條紋庫,它不會像這樣的參數。

條紋庫使用標準的節點回調,如:

Stripe.charges.create({ 
    amount: 100*100, 
    currency: "usd", 
    customer: request.params.customerId, 
    card: request.params.cardId 
}, function(error, charge) { 
    // do something 
});