-2

I am getting the following error when I try to create a customer. I tried downgrading Parse. Currently it is running the latest(2.2.8) version but I tried version 1.4.2 too, and I am still getting the following error. What can be the reason for this "TypeError"?

TypeError: Object [object Object] has no method 'isString' 
at request (stripe.js 49:25) at post (stripe.js:117:12) at
Object.module.exports.Customers.create (stripe.js:239:16) at main.js:15:22

Main.js:

//STRIPE
var Stripe = require("stripe")
Stripe.initialize = ("sk_test_XXXXX");

Parse.Cloud.define("saveCustomerId", function(request, response) {
    Parse.Cloud.useMasterKey();
    Stripe.Customers.create({
        card : request.params.token,
        email: request.params.email,
        description: request.params.description,
    }, {
        success : function(customer) {

        var Usr = request.user;

        var newcust = Parse.Object.extend("Customer");
        var newUsr = new newcust();

          newUsr.set("sCID", customer.id);
            newUsr.set("parent", Usr);

       var pACL = new Parse.ACL();
       pACL.setPublicReadAccess(false);
       pACL.setPublicWriteAccess(false);
       pACL.setReadAccess(Usr, true);
       pACL.setWriteAccess(Usr, true);

        newUsr.set("ACL", pACL);

            newUsr.save(null, {
                success : function(customer) {
                    response.success("customer saved to parse = " + Usr.get("username"));
                },
                error : function(customer, error) {

                    response.error("Ops failed to saved customer id ");
                }
            });
        },
        error : function() {
            response.error("Fejl");
        }
    });
});
EsmaGo
  • 141
  • 1
  • 7

3 Answers3

6

This looks to be a parse API bug, it should be fixed if you roll-back to Parse 1.3.5. In terminal (on mac) or console (on other platforms) type

parse jssdk 1.5.0

SafeFastExpressive
  • 3,637
  • 2
  • 32
  • 39
  • Thanks I tried older version unfortunately it did not help. I fixed the problem by creating modules myself. – EsmaGo Oct 25 '15 at 01:53
  • I had this exact issue with version 1.6.14. As soon as I rolled back to 1.5.0 it worked. Thanks for this – Sasha Reid Jan 13 '16 at 23:25
0

Reported and confirmed bug : https://developers.facebook.com/bugs/1024338347618594/

Did you manage to import the stripe module ?

Maxime L
  • 178
  • 13
0

I fixed that error by creating the Stripe module myself.

EsmaGo
  • 141
  • 1
  • 7