Skip to content

Commit

Permalink
fix: don't capture payments with invoice_id as donations
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
ruchamahabal committed May 24, 2022
1 parent 34928d2 commit 168a9d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion erpnext/non_profit/doctype/donation/donation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 168a9d4

Please sign in to comment.