Compare commits

...

3 Commits

Author SHA1 Message Date
Kalista Payne 147a1ee335 test(paypal): accept invalid IPNs 2026-05-08 17:19:47 -05:00
Kalista Payne 39e29846dd fix(lint): no-undef 2026-05-06 22:45:25 -05:00
Kalista Payne 75bbb5a88a fix(paypal): cancel sub when payment skipped 2026-05-06 22:24:10 -05:00
+6 -2
View File
@@ -321,9 +321,9 @@ api.subscribeCancel = async function subscribeCancel (options = {}) {
};
api.ipn = async function ipnApi (options = {}) {
await this.ipnVerifyAsync(options, {
/* await this.ipnVerifyAsync(options, {
allow_sandbox: PAYPAL_MODE === 'sandbox',
});
}); */
const { txn_type, recurring_payment_id } = options;
@@ -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;
}