Inside Gratipay

This is Gratipay's internal company portal. First time here? Welcome! Start at the top. :-)

Run MassPay

Immediately after payday we send money to some people using PayPal's MassPay feature.

  1. Run update exchange_routes set fee_cap = 20.00 where fee_cap is null and network = 'paypal'; to work around this bug.
  2. Run ./ to hit the database and generate three CSV files. This script is read-only and can safely be run multiple times.
  3. Log in to PayPal and navigate to the MassPay feature.
  4. Upload the .*.paypal.csv file from step 2 and write a note with subject “Gratipay Payout” and body “Here you go! Thanks for using Gratipay! :-)”
  5. Submit the MassPay and double check the amount and the fee against the stdout from step 1 (not to be confused with the output files from step 1!). PayPal caps the fee at $1 for U.S. accounts and $20 for non-U.S. accounts. Unfortunately, the only way to determine the fee cap for a given account (that we've discovered) is to try uploading the CSV MassPay file and see if our guess matches what PayPal in fact computes.
  6. If the amounts don't match then we have a bad paypal_fee_cap for one of the users. Manually bisect the .*.input.csv file from step 2, running ./bin/ -o to generate the .*output.*.csv files, and then running through steps 4 and 5, until you discover the culprit. Manually run update exchange_routes set fee_cap=1 where address='the email address';, then start all over from step 2.
  7. When everything checks out, pull the trigger on the MassPay.
  8. Click “View Activity Details,” and then drill down on the new MassPay.
  9. Wait a few minutes, then refresh the page. You should see “N claimed” or something.
  10. Download the CSV they give you. It will save as MassPayment_Details.csv.
  11. Move the MassPayment_Details.csv file to ../logs/masspay/
  12. cd ../../masspay and git commit the four new files.
  13. cd back to the main repo root and run ./env/bin/python ./bin/ -p to post back to Gratipay using the record-an-exchange endpoint. When prompted enter the “Unique Transaction ID” shown on the PayPal “Transaction details” page for the MassPay, and your own personal Gratipay API key. Make sure this works by inspecting the exchanges table. Don't forget this step!
  14. Note the result on the payday ticket: “MassPay done and posted back for N users.”
Table of Contents