From 168a9d417b57e6441da7e9446100e0de62aeaea5 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Tue, 24 May 2022 18:16:56 +0530 Subject: [PATCH] fix: don't capture payments with invoice_id as donations - if donations and subscriptions are set up in the same dashboard, membership payments also trigger payment webhook - in order to differentiate there is already a check for RP's auto generated description but if subscriptions are configured using subscription links, RP doesn't send descriptions - use invoice_id to ignore such payments instead --- erpnext/non_profit/doctype/donation/donation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/non_profit/doctype/donation/donation.py b/erpnext/non_profit/doctype/donation/donation.py index 8e5ac5b61bf..ed4b3d05b3f 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)