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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user