0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Wired up the members webhook handler endpoint

no-issue
This commit is contained in:
Fabien O'Carroll 2019-09-25 14:21:38 +07:00
parent ab18905c76
commit d4249a07c0
2 changed files with 4 additions and 0 deletions

View file

@ -74,11 +74,14 @@ function getStripePaymentConfig() {
return null;
}
const webhookHandlerUrl = new URL('/members/webhooks/stripe', siteUrl);
return {
publicKey: stripePaymentProcessor.config.public_token,
secretKey: stripePaymentProcessor.config.secret_token,
checkoutSuccessUrl: siteUrl,
checkoutCancelUrl: siteUrl,
webhookHandlerUrl: webhookHandlerUrl.href,
product: stripePaymentProcessor.config.product,
plans: stripePaymentProcessor.config.plans,
appInfo: {

View file

@ -155,6 +155,7 @@ module.exports = function setupSiteApp(options = {}) {
res.end(err.message);
}
});
siteApp.post('/members/webhooks/stripe', membersService.api.middleware.handleStripeWebhook);
siteApp.use(async function (req, res, next) {
if (!labsService.isSet('members')) {
req.member = null;