From 6d0867fcaa82dc634e5c10371669851c2cd58509 Mon Sep 17 00:00:00 2001 From: Chris Modjeska Date: Thu, 14 Nov 2013 15:49:27 -0500 Subject: [PATCH] Added refund_parent method to get a refunds parent notification --- django_clickbank/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/django_clickbank/models.py b/django_clickbank/models.py index 3246b36..9217f44 100644 --- a/django_clickbank/models.py +++ b/django_clickbank/models.py @@ -161,6 +161,15 @@ def parent(self): except: return None + def refund_parent(self): + """ + Gets parent notification for a refund or chargeback + """ + try: + return Notification.objects.get(receipt=self.receipt, transaction_type='SALE') + except: + return None + def rebill_parent(self): """ Gets parent notification of a rebill