I'm trying to create a charge with a test account on stripe.
Here is my parse cloud function:
Parse.Cloud.define("charge", function(request, response) {
var Stripe = require('stripe');
Stripe.initialize('...');
Stripe.Charges.create({
amount: 1000,
currency: "usd",
customer: "..."
},{
success: function(httpResponse) {
response.success("Purchase made!");
},
error: function(httpResponse) {
response.error("Uh oh, something went wrong");
}
});
});
I've hard coded the customerID into the function just for testing.
When I call the function from my app, I get the following error:
TypeError: Object [object Object] has no method '_each'
at request (stripe.js:58:11)
at post (stripe.js:117:12)
at Object.module.exports.Charges.create (stripe.js:157:16)
at main.js:19:18 (Code: 141, Version: 1.6.2)
Can anyone help?