-
-
Save mtermoul/4e2c5adef4236256c1f907af2d100932 to your computer and use it in GitHub Desktop.
crowd-pitch/public/js/Stripe.js
This file contains 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
... | |
app.post('/pay', function(req, res) { | |
stripe.charges.create({ | |
amount: Number(req.body.amount) * 100, // amount in cents | |
currency: 'usd', | |
description: `${req.body.firstName} ${req.body.lastName} (${req.body.email}) - ${req.body.orderSummary} - Source: ${req.body.pageSource}`, | |
source: req.body.stripeToken, | |
statement_descriptor: 'CROWD-PITHC GOOG CASHM' | |
}) | |
.then(charge => { | |
res.send(charge); | |
}) | |
.catch(error => { | |
console.log('--- Error:', error); | |
res.status(500).send(error); | |
}); | |
}); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment