Fixed error handling webhook for unknown member

refs https://github.com/TryGhost/Team/issues/1374

We cannot update payment details for members which we don't know about,
so returning and giving a successful response to Stripe is the correct
thing to do.
This commit is contained in:
Fabien "egg" O'Carroll 2022-02-17 13:48:46 +02:00
parent e400b4d8f4
commit f452df7e92

View File

@ -152,6 +152,10 @@ module.exports = class WebhookController {
customer_id: setupIntent.metadata.customer_id
});
if (!member) {
return;
}
await this.api.attachPaymentMethodToCustomer(
setupIntent.metadata.customer_id,
setupIntent.payment_method