Last active
October 4, 2016 23:33
-
-
Save amazingandyyy/c3afd6176c3962904d72d37e69671146 to your computer and use it in GitHub Desktop.
Stripe payment API (NodeJS snippet)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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