Advertisement
Guest User

Untitled

a guest
May 31st, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. ...
  2. var stripeCharge = require('./stripeCharge.js')
  3.  
  4. ...
  5.  
  6. app.post('/api/purchase', parseURLencoded, function(req, res) {
  7. var auth = req.headers['authorization']
  8. if (auth !== "false") {
  9. var token = req.body.token
  10. stripeCharge.charge(token)
  11. res.status(201)
  12. } else {
  13. res.status(401).send("Unauthorized.")
  14. }
  15. })
  16.  
  17. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement