Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Report on total post-backs for MassPay #2494

Merged
merged 1 commit into from
Jun 12, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bin/masspay.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def post_back_to_gittip():
except KeyError:
gittip_base_url = 'https://www.gittip.com'

nposts = 0
for username, email, gross, fee, net, additional_note in csv.reader(open(GITTIP_CSV)):
url = '{}/{}/history/record-an-exchange'.format(gittip_base_url, username)
note = 'PayPal MassPay to {}.'.format(email)
Expand All @@ -210,13 +211,16 @@ def post_back_to_gittip():
except IncompleteRead:
print('IncompleteRead, proceeding (but double-check!)')
else:
if response.status_code != 200:
if response.status_code == 200:
nposts += 1
else:
if response.status_code == 404:
print('Got 404, is your API key good? {}'.format(gittip_api_key))
else:
print('... resulted in a {} response:'.format(response.status_code))
print(response.text)
raise SystemExit
print("POSTed MassPay back to Gittip for {} users.".format(nposts))


def run_report():
Expand Down