1

I'm trying to charge a card on Stripe using the Stripe Cloud Code Module.

My code has worked previously, but suddenly I'm getting this error seemingly from within stripe.js

TypeError: Object [object Object] has no method 'isString'
at request (stripe.js:49:25)
at post (stripe.js:117:12)
at Object.module.exports.Charges.create (stripe.js:157:16)
at main.js:6:20

Here's my code (minus my key of course):

    var Stripe = require('stripe');
    Stripe.initialize('#################');
    Parse.Cloud.define("preOrder", function(request, response) {
        var tok = String(request.params.token)
        Stripe.Charges.create({
            amount: 100 * 40,
            currency: "usd",
            card: tok // the token id should be sent from the client
        },{
            success: function(httpResponse) {
                response.success("Purchase made!");
            },
            error: function(httpResponse) {
                response.error("Uh oh, something went wrong");
        }
      });
   });
  • How much did you try? This post suggests reverting cloud code to 1.5 http://stackoverflow.com/questions/32544979/parse-stripe-ios-main-js same goes for this one http://stackoverflow.com/questions/32573109/error-when-creating-charge-with-parse-com-stripe-api – cYrixmorten Nov 09 '15 at 17:40

1 Answers1

0

This is a bug in the current Stripe module provided by Parse. I've reported this to Facebook here. I ended up moving my Stripe payment processing to Heroku to circumvent this problem.

hhanesand
  • 990
  • 11
  • 28