Skip to content

Instantly share code, notes, and snippets.

@amazingandyyy
Last active October 4, 2016 23:33
Show Gist options
  • Save amazingandyyy/c3afd6176c3962904d72d37e69671146 to your computer and use it in GitHub Desktop.
Save amazingandyyy/c3afd6176c3962904d72d37e69671146 to your computer and use it in GitHub Desktop.
Stripe payment API (NodeJS snippet)
// use strip API to charge the card
var stripe = require('stripe')(process.env.STRIPE_API_SECRET)
// ... in models.js
stripe.charges.create({
amount: 50 * 100, // 50.00 dollars
currency: "usd",
source: dataObj.stripeToken.id,
description: `payment verification for ${dataObj.userData._id}!`
}, cb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment