text: const keys = require('../config/keys')
  const stripe = require('stripe')(keys.stripeSecretKey)
  const requirelogin = require('../middlewares/requireLogin')
  
  module.exports = (app) => {
    app.post('/api/stripe', requirelogin, async (req, res) => {
      await stripe.charges.create({
        amount: 500,
        currency: 'usd',
        description: '$5 for 5 credits',
        source: req.body.id,
      })
  
      req.user.credits += 5
      const user = await req.user.save()
      res.send(user)
    })
  }
  