diff --git a/website/server/libs/paypalPayments.js b/website/server/libs/paypalPayments.js index 2161436964..044983a7f0 100644 --- a/website/server/libs/paypalPayments.js +++ b/website/server/libs/paypalPayments.js @@ -231,7 +231,14 @@ api.ipn = async function ipnApi (options = {}) { let {txn_type, recurring_payment_id} = options; - if (['recurring_payment_profile_cancel', 'subscr_cancel'].indexOf(txn_type) === -1) return; + let ipnAcceptableTypes = [ + 'recurring_payment_profile_cancel', + 'recurring_payment_failed', + 'recurring_payment_expired', + 'subscr_cancel', + 'subscr_failed']; + + if (ipnAcceptableTypes.indexOf(txn_type) === -1) return; // @TODO: Should this request billing date? let user = await User.findOne({ 'purchased.plan.customerId': recurring_payment_id }).exec(); if (user) {