From 8ef99ba82818309485f6b87767cf622f96a7e055 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Tue, 30 Apr 2019 09:50:17 +0200 Subject: [PATCH] Dekodi: Merchant PayPal IDs --- src/pretix/base/exporters/dekodi.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pretix/base/exporters/dekodi.py b/src/pretix/base/exporters/dekodi.py index b161c1ea5..9477d505b 100644 --- a/src/pretix/base/exporters/dekodi.py +++ b/src/pretix/base/exporters/dekodi.py @@ -49,10 +49,15 @@ class DekodiNREIExporter(BaseExporter): ): if p.provider == 'paypal': paypal_email = p.info_data.get('payer', {}).get('payer_info', {}).get('email') + try: + ppid = p.info_data['transactions'][0]['related_resources']['sale']['id'] + except: + ppid = p.info_data.get('id') payments.append({ 'PTID': '1', 'PTN': 'PayPal', - 'PTNo1': p.info_data.get('id'), + 'PTNo1': ppid, + 'PTNo2': p.info_data.get('id'), 'PTNo7': round(float(p.amount), 2), 'PTNo8': str(self.event.currency), 'PTNo11': paypal_email or '',