mrgalaxy:stripe

v2.1.0Published 10 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

A Meteor package containing Stripe scripts:

Install

Using Meteor's Package System:

$ meteor add mrgalaxy:stripe

Usage

Client

Stripe.js is now loaded after all other Meteor scripts so the Stripe variable is not going to available when your app first runs. Instead, all calls need to be made after your Meteor app has started, like so:

1Meteor.startup(function() {
2    Stripe.setPublishableKey('YOUR_PUBLISHABLE_KEY');
3});

The same goes for StripeCheckout, too:

1Meteor.startup(function() {
2    var handler = StripeCheckout.configure({
3		key: 'YOUR_PUBLISHABLE_KEY',
4		token: function(token) {}
5	});
6});

See the Stripe docs (https://stripe.com/docs/stripe.js, https://stripe.com/docs/checkout) for all the API specifics.

Server

To initiate a Stripe object:

var Stripe = StripeAPI('YOUR_SECRET_API_KEY');

And then use it:

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

For a complete reference, please see the original: https://github.com/stripe/stripe-node