Adding Stripe to Meteor - Unable to read property setPublishableKey 'from undefined

I'm trying to get a stripe integrated into my meteor app using the Atmosphere package ( https://atmospherejs.com/mrgalaxy/stripe ) and I can't figure out which is why I'm getting this error. Here's what I have at the moment:

The repo is cloned into packages / lane

Returning a list of meteorites - mrgalaxy: stripe 1.5.6 Stripe.js and Node -Page brought to Meteor.

When I tried to run 'meteor add stripe' I got 'strip: no such a package', so I added it like it said in Atmosphere. (meteor metralaxy: strip).

It looks like the JS file for the package is loaded in the browser when I inspect it, but I still get this error, which leads me to believe that I am not including the package correctly. Any thoughts? If you need more information for debugging, I'd be happy to provide it. Thanks in advance!


Main.js

'click #submit-btn': function() {
  Stripe.setPublishableKey('PUBLISHABLE_KEY');      
  var Stripe = StripeAPI('SECRET_KEY');

  Stripe.charges.create({
      amount: 10,
      currency: "USD",
      card: {
          number: "4242424242424242",
          exp_month: "03",
          exp_year: "2014"
      }
  }, function (err, res) {
      console.log(err, res);
      return false;
  });
}

      

+3


source to share


1 answer


Stripe only.setPublishableKey ('YOUR_PUBLISHABLE_KEY'); maybe in the client.



The click event should make Meteor.call to Meteor.method on the server that runs the rest of the code.

+3


source







All Articles