Awight has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/239507

Change subject: Parse and send the contribution tracking ID, if available
......................................................................

Parse and send the contribution tracking ID, if available

Bug: T113087
Change-Id: I756b50a146338f16a76968efd2b2dedab6f5ac56
---
M audit/paypal/README
M audit/paypal/TrrFile.py
2 files changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/07/239507/1

diff --git a/audit/paypal/README b/audit/paypal/README
index 88dfbb2..2f692c0 100644
--- a/audit/paypal/README
+++ b/audit/paypal/README
@@ -1,3 +1,3 @@
-apt-get install python-paramiko python-yaml
+apt-get install python-paramiko python-yaml python-stompy python-mysqldb
 
 cp config.yaml.example /etc/fundraising/paypal-audit.yaml
diff --git a/audit/paypal/TrrFile.py b/audit/paypal/TrrFile.py
index a81edf2..42db7f8 100644
--- a/audit/paypal/TrrFile.py
+++ b/audit/paypal/TrrFile.py
@@ -3,6 +3,8 @@
 See 
https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/PP_LRD_Gen_TransactionDetailReport.pdf
 '''
 
+import re
+
 from process.logging import Logger as log
 from process.globals import config
 from queue.stomp_wrap import Stomp
@@ -132,6 +134,9 @@
         if row['PayPal Reference ID Type'] == 'SUB':
             out['subscr_id'] = row['PayPal Reference ID']
 
+        if re.search('^[0-9]+$', row['Transaction Subject']):
+            out['contribution_tracking_id'] = row['Transaction Subject']
+
         event_type = row['Transaction Event Code'][0:3]
 
         queue = None

-- 
To view, visit https://gerrit.wikimedia.org/r/239507
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I756b50a146338f16a76968efd2b2dedab6f5ac56
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to