Skip to content

Instantly share code, notes, and snippets.

@refaelos
Last active January 17, 2016 20:33
Show Gist options
  • Select an option

  • Save refaelos/ca4ede66747cb2c24ad4 to your computer and use it in GitHub Desktop.

Select an option

Save refaelos/ca4ede66747cb2c24ad4 to your computer and use it in GitHub Desktop.
stripe charge
var stripe = require("stripe")(
process.env.NODE_ENV==="production" ? "xxx_live" : "xxx_test"
);
stripe.charges.create({
amount : 50,
currency : "usd",
source : token, // obtained with Stripe.js
description: "Charge for user"
}, function (err, charge) {
//...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment