• Stars
    star
    150
  • Rank 247,323 (Top 5 %)
  • Language
    JavaScript
  • Created almost 12 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Meteor package containing Stripe.js, Node-Stripe, and Stripe Checkout.

A Meteor package containing Stripe scripts:

Install

Using Meteor's Package System:

$ meteor add mrgalaxy:stripe

Usage

Client

In order for Stripe.js to be loaded directly on iOS and Android a new rule needs to be created in your mobile-config.js located in the root of your project. Create the new file if it doesn't already exist and insert the line below.

App.accessRule('https://*.stripe.com/*');

In order to allow the Stripe variable to be accessible it must be loaded in the Meteor.startup. This will ensure that calls are deferred until after your Meteor app has started.

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

The same goes for Stripe Checkout, too:

Meteor.startup(function() {
    var handler = StripeCheckout.configure({
		key: 'YOUR_PUBLISHABLE_KEY',
		token: function(token) {}
	});
});

In order to remain PCI compliant under the new DSS 3.0 rules, never send credit card details to the server. Use client-side credit card details to create a secure token, per this example:

ccNum = $('#ccnum').val();
cvc = $('#cvc').val();
expMo = $('#exp-month').val();
expYr = $('#exp-year').val();

Stripe.card.createToken({
	number: ccNum,
	cvc: cvc,
	exp_month: expMo,
	exp_year: expYr,
}, function(status, response) {
	stripeToken = response.id;
	Meteor.call('chargeCard', stripeToken);
});

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

Server

Meteor.methods({
  'chargeCard': function(stripeToken) {
    var Stripe = StripeAPI('SECRET_KEY');

    Stripe.charges.create({
      amount: 1000,
      currency: 'usd',
      source: stripeToken
    }, function(err, charge) {
      console.log(err, charge);
    });
  }
});

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

More Repositories

1

simple-text-parser

A simple, customizable plain text parser for Node.js and browsers.
TypeScript
53
star
2

couchdb-auth-proxy

An HTTP reverse proxy server for easy Couchdb proxy authentication
JavaScript
28
star
3

json-toolkit

A simple Node.js library to do extensive things with JSON.
CoffeeScript
22
star
4

pouchdb-design

Design document helpers for PouchDB.
JavaScript
9
star
5

node-elophant

Node.js Library for connecting to Elophant's API and Riot's League of Legends game data.
CoffeeScript
9
star
6

shorturl

A URL shortening service powered by Node.js and Redis
JavaScript
9
star
7

bootstrap-package-manager

A simple command line interface for installing and compiling Twitter Bootstrap.
JavaScript
8
star
8

couchdb-jwt-redis-store

A Redis-backed session store for couchdb-jwt.
JavaScript
8
star
9

tendr

Simple, flexible asset management for Node.js.
CoffeeScript
7
star
10

pouchdb-security-helper

A small library for dealing with security documents in PouchDB.
JavaScript
6
star
11

pouchdb-access

A PouchDB plugin that provides simple access control for CouchDB databases.
JavaScript
5
star
12

pouchdb-subscribe

PouchDB query API based on Meteor's Minimongo.
JavaScript
4
star
13

autorelease

Automatically release NPM packages based on commit messages.
JavaScript
3
star
14

async-while

Asynchronous while loops using ES6 Promises.
JavaScript
3
star
15

express-jwt-pouchdb

Express-PouchDB with JSON Web Token Support.
JavaScript
3
star
16

node-xvfb-docker

Node.js + Xvfb Dockerfile
2
star
17

crafty

A Minecraft web GUI built with Node.js
JavaScript
2
star
18

browserify-pegjs

Browserify v2 plugin for PegJS files.
JavaScript
2
star
19

shorturl-docker

Builds the Docker image for tyler-johnson/shorturl
JavaScript
2
star
20

Turbo

A content managment platform built on Node.js.
CSS
2
star
21

superfast-runtime

JavaScript
1
star
22

realm-viewer

A Node.js server that fetches Minecraft Realms worlds and renders/hosts them as Overviewer maps.
JavaScript
1
star
23

pouchdb-couchdb

Provides some extra CouchDB sugar to PouchDB.
JavaScript
1
star
24

trackr-storage

Reactive localStorage and sessionStorage.
JavaScript
1
star
25

plain-merge

A small utility for merging plain JavaScript objects.
JavaScript
1
star
26

nightbot-squads

Squad commands for Nightbot.
HTML
1
star
27

Legends

A small League of Legends API library for Node.js and browsers.
JavaScript
1
star