summaryrefslogtreecommitdiff
path: root/postgresqleu/paypal/util.py
diff options
context:
space:
mode:
authorMagnus Hagander2019-08-07 14:24:27 +0000
committerMagnus Hagander2019-08-07 14:24:27 +0000
commit136b2635f3b4e5e691458009ac3e7449d5646502 (patch)
treec3d86362e5173c22925e8c3bf469fedab6259bfb /postgresqleu/paypal/util.py
parentaf69b756ac9806620df835b979739bdfa447344c (diff)
Try to deal with new paypal chargeback fees
Diffstat (limited to 'postgresqleu/paypal/util.py')
-rw-r--r--postgresqleu/paypal/util.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/postgresqleu/paypal/util.py b/postgresqleu/paypal/util.py
index 3ffa72f9..2211a078 100644
--- a/postgresqleu/paypal/util.py
+++ b/postgresqleu/paypal/util.py
@@ -110,9 +110,10 @@ class PaypalAPI(object):
yield r
continue
- if code in ('T1106', 'T1108'):
+ if code in ('T1106', 'T1108', 'T0106'):
# "Payment reversal, initiated by PayPal", *sometimes* has email and
# sometimes not. Undocumented when they differ.
+ # T0106 is chargeback fee, also from no real sender
r['EMAIL'] = t['payer_info'].get('email_address', self.pm.config('email'))
if not r['EMAIL']:
@@ -155,6 +156,8 @@ class PaypalAPI(object):
r['SUBJECT'] = 'Reversal of {0}'.format(t['transaction_info']['paypal_reference_id'])
elif code == 'T1108':
r['SUBJECT'] = 'Reversal of fee for {0}'.format(t['transaction_info']['paypal_reference_id'])
+ elif code == 'T0106':
+ r['SUBJECT'] = 'Paypal chargeback fee for {0}'.format(t['transaction_info']['paypal_reference_id'])
else:
raise Exception("Unknown paypal transaction event code %s" % code)