Skip to content

Instantly share code, notes, and snippets.

@fostergn
Last active May 23, 2018 20:44
Show Gist options
  • Save fostergn/c0c86e19a3f37122cf13e189ba460e26 to your computer and use it in GitHub Desktop.
Save fostergn/c0c86e19a3f37122cf13e189ba460e26 to your computer and use it in GitHub Desktop.
const addApiIncrease = async (req, res, next) => {
stripe.setApiVersion('2018-05-21');
const billingId = req.account.billing.customer_id;
const newSubscription = await stripe.subscriptions.create({
customer: billingId,
items: [
{
plan: 'api_141121_25',
quantity: req.body.quantity
}
]
}).catch(err => {
logger.error(err, req);
return res.jsonp({
error: err
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment