diff --git a/erpnext/non_profit/doctype/donation/donation.py b/erpnext/non_profit/doctype/donation/donation.py index 8e5ac5b61bf4..ed4b3d05b3ff 100644 --- a/erpnext/non_profit/doctype/donation/donation.py +++ b/erpnext/non_profit/doctype/donation/donation.py @@ -100,7 +100,9 @@ def capture_razorpay_donations(*args, **kwargs): return # to avoid capturing subscription payments as donations - if payment.description and "subscription" in str(payment.description).lower(): + if payment.invoice_id or ( + payment.description and "subscription" in str(payment.description).lower() + ): return donor = get_donor(payment.email)