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

Commit

Permalink
Explain penny in exchange note; #1673
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Nov 15, 2013
1 parent cbcf901 commit 0730497
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion masspay.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class Payee(object):
gross_perc = None
fee = None
net = None
additional_note = ""

def __init__(self, rec):
self.username, self.email, amount = rec
Expand Down Expand Up @@ -93,6 +94,7 @@ def assess_fee(self):

self.gross -= D('0.01')
self.net -= D('0.01')
self.additional_note = "Penny remaining due to PayPal rounding limitation."
return fee


Expand Down Expand Up @@ -152,6 +154,7 @@ def compute_output_csvs():
, payee.gross
, payee.fee
, payee.net
, payee.additional_note
))
print("{username:<24}{email:<32} {gross:>7} {fee:>7} {net:>7}".format(**payee.__dict__))

Expand All @@ -171,9 +174,11 @@ def record_exchanges_in_gittip():
except KeyError:
gittip_base_url = 'https://www.gittip.com'

for username, email, gross, fee, net in csv.reader(open(GITTIP_CSV)):
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)
if additional_note:
note += " " + additional_note
data = {'amount': '-' + net, 'fee': fee, 'note': note}
requests.post(url, auth=(gittip_api_key, ''), data=data)
print(note)
Expand Down

0 comments on commit 0730497

Please sign in to comment.