meteorhacks:stripe

v2.0.1Published 9 years ago

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

Stripe for Meteor

Features

  • All Stripe methods can be used synchronously (uses fibers)
  • Load client side resources asynchronously

Usage

First, initialize Stripe configurations on the server side:

1Stripe.configure({
2  appName: 'Application Name',
3  appLogo: 'http://mysite.com/assets/logo.png',
4  apiKey: 'STRIPE_API_KEY',
5  publishableKey: 'STRIPE_PUBLISHABLE_KEY',
6});

After that, you can use any Stripe NodeJS API in sync manner inside both methods and publications.

Stripe Checkout

You can easily get a Stripe Checkout handle like this:

1// Wait until Stripe JS apis are loaded
2StripeUtils.ready(function() {
3  var handle = Stripe.getCheckoutHandler({
4    amount: 0,
5    description: plan.description,
6    panelLabel: "Subscribe",
7    token: function(cardInfo) {
8      // do something with the card
9      // usually you'll need to call a Meteor method
10    }
11  });
12
13  handle.open();
14});