summaryrefslogtreecommitdiff
path: root/postgresqleu/paypal/util.py
diff options
context:
space:
mode:
authorMagnus Hagander2019-07-31 09:29:43 +0000
committerMagnus Hagander2019-07-31 09:29:43 +0000
commitab6779b621a851063bec0d2954ee84f1fc5d2d79 (patch)
tree042153b9b79b15c804112f319b094464df31a12d /postgresqleu/paypal/util.py
parentc842a52050c767f125852f89f7d73093d4607955 (diff)
Handle that paypal T1106 is sometimes accompanied by a T1108
Diffstat (limited to 'postgresqleu/paypal/util.py')
-rw-r--r--postgresqleu/paypal/util.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/postgresqleu/paypal/util.py b/postgresqleu/paypal/util.py
index d7d38096..3ffa72f9 100644
--- a/postgresqleu/paypal/util.py
+++ b/postgresqleu/paypal/util.py
@@ -110,7 +110,7 @@ class PaypalAPI(object):
yield r
continue
- if code == 'T1106':
+ if code in ('T1106', 'T1108'):
# "Payment reversal, initiated by PayPal", *sometimes* has email and
# sometimes not. Undocumented when they differ.
r['EMAIL'] = t['payer_info'].get('email_address', self.pm.config('email'))
@@ -153,6 +153,8 @@ class PaypalAPI(object):
elif code == 'T1106':
# Payment reversal initiated by paypal
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'])
else:
raise Exception("Unknown paypal transaction event code %s" % code)