Squashed commit of the following:
commit 39e29846dd409024ac40b2fb3bb3944ddf9813d2 Author: Kalista Payne <kalista@habitica.com> Date: Wed May 6 22:45:25 2026 -0500 fix(lint): no-undef commit 75bbb5a88ae8bbc495203c47e15b3889f942c338 Author: Kalista Payne <kalista@habitica.com> Date: Wed May 6 22:24:10 2026 -0500 fix(paypal): cancel sub when payment skipped
This commit is contained in:
@@ -331,6 +331,7 @@ api.ipn = async function ipnApi (options = {}) {
|
||||
'recurring_payment_profile_cancel',
|
||||
'recurring_payment_failed',
|
||||
'recurring_payment_expired',
|
||||
'recurring_payment_skipped',
|
||||
'subscr_cancel',
|
||||
'subscr_failed',
|
||||
];
|
||||
@@ -345,6 +346,9 @@ api.ipn = async function ipnApi (options = {}) {
|
||||
// resulting in the loss of subscription credits
|
||||
if (user.hasCancelled()) return;
|
||||
|
||||
if (txn_type === 'recurring_payment_skipped') {
|
||||
await this.paypalBillingAgreementCancel(recurring_payment_id, { note: 'Missed payment' });
|
||||
}
|
||||
await payments.cancelSubscription({ user, paymentMethod: this.constants.PAYMENT_METHOD });
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user