Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- var stripeCharge = require('./stripeCharge.js')
- ...
- app.post('/api/purchase', parseURLencoded, function(req, res) {
- var auth = req.headers['authorization']
- if (auth !== "false") {
- var token = req.body.token
- stripeCharge.charge(token)
- res.status(201)
- } else {
- res.status(401).send("Unauthorized.")
- }
- })
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement