Page MenuHomePhabricator

Create tool for fixing recurring PayPal donations without utokens
Closed, ResolvedPublic5 Estimated Story Points

Description

Issue: Some recurring PayPal donations are not handled (i.e. no donation is created and exported to VEWA) and show up with the message Wrong access code for donation in paypal.log.

Cause: Some recurring PayPal donations from the 2013 campaign that have no utoken set in their donation data (in our database), but a utoken was sent to PayPal and is contained in the IPN message from PayPal. The fundraising frontend checks the utoken on incoming request from PayPal and rejects the IPN if both do not match.

Background Information: The combination of utoken and donation can only be reconstructed from paypal.log for the cases recorded there. Unfortunately, the utoken is not available in the PayPal administration web GUI.

Fix:

  1. Create a [[ https://stedolan.github.io/jq/ | jq ]] query file that can extract utoken and donation ID as CSV from the PayPal failure messages (Wrong access code for donation) of archived paypal.log files (wmfg-backup@monitor.wikimedia.de).
  2. Create a CLI tool for the backend that queries the donations for "recurring PayPal donations with empty utoken (empty string)" and can use the extracted data from the previous step. The tool should have two modes/features:
    • Generate a CSV report for the fundraising team so they can see which donations are affected. Columns should be donation id, subscription id, donation date, email (optional), fixable (optional). the optional columns are for cases where we have extracted data.
    • Write the utoken to the database for cases where the donation id from our database selection matches the donation ID (field sid) from the PayPal data.

Application of the fix:

  • The fundraising team should get the first report and give us feedback which donors we can ignore because they are no longer donating.
  • The extraction and "fix" scripts should be run by us manually (once per month) until January 2018, as the only source of fixing the donation data are incoming PayPal messages.

Related Objects

Event Timeline

gabriel-wmde triaged this task as Medium priority.
gabriel-wmde set the point value for this task to 5.

Applid the fix the live data. Output:

164 donations without update tokens found, 82 of them found in paypal data.
              yearly,  35 unrepaired,  34 repaired
            biannual,   8 unrepaired,   9 repaired
             monthly,  21 unrepaired,  20 repaired
           quarterly,  18 unrepaired,  19 repaired

Will create a calendar invitation for all FR developers to be notified monthly.

Great to see that we could fix 50% on the first go!
Concerning "monthly" - I interpreted Mia's "Ich würde sagen es reicht, wenn Ihr uns final dann wissen lasst" in that way that once, next year would be enough?!