add stripe webhook to handle cancelled subscriptions

This commit is contained in:
Matteo Pagliazzi
2017-03-19 20:05:50 +01:00
parent 0ec293bd15
commit 207e3476e6
4 changed files with 96 additions and 4 deletions

View File

@@ -87,4 +87,14 @@ api.subscribeCancel = {
},
};
api.handleWebhooks = {
method: 'POST',
url: '/stripe/webhook',
async handler (req, res) {
await stripePayments.handleWebhooks({requestBody: req.body});
return res.respond(200, {});
},
};
module.exports = api;