javascript - Error in Parse Cloud Code with Stripe module in Swift -
i getting error:
result: typeerror: object [object object] has no method '_each' @ request (stripe.js:58:11) @ post (stripe.js:117:12) @ object.module.exports.customers.create (stripe.js:239:16) @ main.js:13:22
this swift function call:
let userid = pfuser.currentuser()?.objectid let useremail = pfuser.currentuser()?.email pfcloud.callfunctioninbackground("createcustomer", withparameters: ["email": useremail!, "objectid": userid!])
this cloud code specific function:
var stripe = require('stripe'); stripe.initialize('sk_test_***************'); parse.cloud.define("createcustomer", function(request, response) { stripe.customers.create({ email: request.params.email, description: 'new gyro user', metadata: { //name: request.params.name, userid: request.params.objectid, // e.g pfuser object id createwithcard: false } }, { success: function(httpresponse) { response.success(customerid); // return customerid }, error: function(httpresponse) { console.log(httpresponse); response.error("cannot create new customer."); } }); });
i'm not sure , why getting error. appreciated.
Comments
Post a Comment