I’m creating a Meteor app that will sell one of our customer’s products. I’ve decided to try and use Stripe to handle the payments (in particular Stripe Connect), and to charge an ‘application fee’ for each sale. I have seen several tutorials, but nothing for Meteor 1.3, which I would prefer to use.
My questions:
-
Do I still need to use
mrgalaxy:stripe
orkadira:stripe-connect
in order to use the Node API for Stripe? I have tried to use both, and am getting incredibly confused with the documentation of these packages, which I now believe are outdated. -
If not, exactly how should I install and import Stripe for my app?
-
What do I need to do differently on client and on server to import Stripe?
What I have tried:
In my app directory:
meteor npm install --save stripe
.
In my client side javascript code:
import stripe from "stripe"
var stripe = require("stripe"("sk_******************")
Meteor.startup(function() {
stripe.setPublishableKey("sk_******************");
});
Some sources say that the first line should import the package, but the NPM documentation suggests otherwise. Using this code, chrome’s debugger gives me :
Uncaught TypeError: require("...").createServer is not a function
which is running in node_modules/stripe/lib/stripe.js
, and the "..."
is actually "http"
in the stripe.js
.
I am epically confused right now and would give my right index finger for clear instruction on what exactly to write in my javascript file, so I can go from where I am now to creating my first charge
object.
Thanks in advance!