mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
Specifying paypal specifically when deleting payments.
This commit is contained in:
parent
6b0dc6dd51
commit
ae6ce4d241
1 changed files with 2 additions and 4 deletions
|
@ -492,7 +492,7 @@ class Profile(models.Model):
|
|||
self.retrieve_paypal_ids()
|
||||
if self.paypal_sub_id:
|
||||
seen_payments = set()
|
||||
seen_payment_history = PaymentHistory.objects.filter(user=self.user)
|
||||
seen_payment_history = PaymentHistory.objects.filter(user=self.user, payment_provider="paypal")
|
||||
deleted_paypal_payments = 0
|
||||
for payment in list(seen_payment_history):
|
||||
if payment.payment_date.date() in seen_payments:
|
||||
|
@ -540,6 +540,7 @@ class Profile(models.Model):
|
|||
payment_amount=int(float(transaction['amount_with_breakdown']['gross_amount']['value'])),
|
||||
payment_provider='paypal',
|
||||
refunded=refunded)
|
||||
|
||||
ipns = PayPalIPN.objects.filter(Q(custom=self.user.username) |
|
||||
Q(payer_email=self.user.email) |
|
||||
Q(custom=self.user.pk)).order_by('-payment_date')
|
||||
|
@ -551,9 +552,6 @@ class Profile(models.Model):
|
|||
continue
|
||||
seen_payments.add(created)
|
||||
total_paypal_payments += 1
|
||||
# refunded = None
|
||||
# if transaction['status'] in ['PARTIALLY_REFUNDED', 'REFUNDED']:
|
||||
# refunded = True
|
||||
PaymentHistory.objects.get_or_create(user=self.user,
|
||||
payment_date=created,
|
||||
payment_amount=int(transaction.payment_gross),
|
||||
|
|
Loading…
Add table
Reference in a new issue