Forcing payments from paypal to not be duped.

This commit is contained in:
Samuel Clay 2014-11-07 14:58:18 -08:00
parent 92d689303e
commit cc03510c46

View file

@ -226,12 +226,15 @@ class Profile(models.Model):
# Record Paypal payments
paypal_payments = PayPalIPN.objects.filter(custom=self.user.username,
payment_status='Completed',
txn_type='subscr_payment')
if not paypal_payments.count():
paypal_payments = PayPalIPN.objects.filter(payer_email=self.user.email,
payment_status='Completed',
txn_type='subscr_payment')
if alt_email and not paypal_payments.count():
paypal_payments = PayPalIPN.objects.filter(payer_email=alt_email,
payment_status='Completed',
txn_type='subscr_payment')
if paypal_payments.count():
# Make sure this doesn't happen again, so let's use Paypal's email.