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

Commit

Permalink
Drop payment processing fees to cost; #1031
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Jun 17, 2013
1 parent 10ceaa1 commit 20b5fa0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 43 deletions.
10 changes: 5 additions & 5 deletions gittip/billing/payday.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@
# compute this using *ahem* math.

FEE_CHARGE = ( Decimal("0.30") # $0.30
, Decimal("1.039") # 3.9%
, Decimal("0.029") # 2.9%
)
FEE_CREDIT = Decimal("0.30")
FEE_CREDIT = Decimal("0.25")

MINIMUM_CHARGE = Decimal("9.32")
MINIMUM_CHARGE = Decimal("9.41")
MINIMUM_CREDIT = Decimal("10.00")


def upcharge(amount):
"""Given an amount, return a higher amount and the difference.
"""
typecheck(amount, Decimal)
charge_amount = (amount + FEE_CHARGE[0]) * FEE_CHARGE[1]
charge_amount = (amount + FEE_CHARGE[0]) / (1 - FEE_CHARGE[1])
charge_amount = charge_amount.quantize(FEE_CHARGE[0], rounding=ROUND_UP)
return charge_amount, charge_amount - amount

Expand All @@ -60,7 +60,7 @@ def skim_credit(amount):
typecheck(amount, Decimal)
return amount - FEE_CREDIT, FEE_CREDIT

assert upcharge(MINIMUM_CHARGE) == (Decimal('10.00'), Decimal('0.68'))
assert upcharge(MINIMUM_CHARGE) == (Decimal('10.00'), Decimal('0.59'))


def is_whitelisted(participant):
Expand Down
50 changes: 23 additions & 27 deletions tests/test_billing_payday.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ def test_mark_charge_success(self):
@mock.patch('stripe.Charge')
def test_charge_on_stripe(self, ba):
amount_to_charge = Decimal('10.00') # $10.00 USD
expected_fee = (amount_to_charge + FEE_CHARGE[0]) * FEE_CHARGE[1]
expected_fee = (amount_to_charge - expected_fee.quantize(
FEE_CHARGE[0], rounding=ROUND_UP)) * -1
expected_fee = Decimal('0.61')
charge_amount, fee, msg = self.payday.charge_on_stripe(
self.alice.username, self.STRIPE_CUSTOMER_ID, amount_to_charge)

Expand All @@ -214,9 +212,7 @@ def test_charge_on_stripe(self, ba):
@mock.patch('balanced.Account')
def test_charge_on_balanced(self, ba):
amount_to_charge = Decimal('10.00') # $10.00 USD
expected_fee = (amount_to_charge + FEE_CHARGE[0]) * FEE_CHARGE[1]
expected_fee = (amount_to_charge - expected_fee.quantize(
FEE_CHARGE[0], rounding=ROUND_UP)) * -1
expected_fee = Decimal('0.61')
charge_amount, fee, msg = self.payday.charge_on_balanced(
self.alice.username, self.BALANCED_ACCOUNT_URI, amount_to_charge)
self.assertEqual(charge_amount, amount_to_charge + fee)
Expand All @@ -232,7 +228,7 @@ def test_charge_on_balanced(self, ba):
@mock.patch('balanced.Account')
def test_charge_on_balanced_small_amount(self, ba):
amount_to_charge = Decimal('0.06') # $0.06 USD
expected_fee = Decimal('0.68')
expected_fee = Decimal('0.59')
expected_amount = Decimal('10.00')
charge_amount, fee, msg = \
self.payday.charge_on_balanced(self.alice.username,
Expand Down Expand Up @@ -278,61 +274,61 @@ def prep(self, amount):

def test_prep_hit_basically_works(self):
actual = self.payday._prep_hit(Decimal('20.00'))
expected = (2110,
u'Charging %s 2110 cents ($20.00 + $1.10 fee = $21.10) on %s ' u'... ',
Decimal('21.10'), Decimal('1.10'))
expected = (2091,
u'Charging %s 2091 cents ($20.00 + $0.91 fee = $20.91) on %s ' u'... ',
Decimal('20.91'), Decimal('0.91'))
assert actual == expected, actual

def test_prep_hit_full_in_rounded_case(self):
actual = self.payday._prep_hit(Decimal('5.00'))
expected = (1000,
u'Charging %s 1000 cents ($9.32 [rounded up from $5.00] + ' u'$0.68 fee = $10.00) on %s ... ',
Decimal('10.00'), Decimal('0.68'))
u'Charging %s 1000 cents ($9.41 [rounded up from $5.00] + ' u'$0.59 fee = $10.00) on %s ... ',
Decimal('10.00'), Decimal('0.59'))
assert actual == expected, actual

def test_prep_hit_at_ten_dollars(self):
actual = self.prep(u'10.00')
expected = (1071, Decimal('10.71'), Decimal('0.71'))
expected = (1061, Decimal('10.61'), Decimal('0.61'))
assert actual == expected, actual

def test_prep_hit_at_forty_cents(self):
actual = self.prep(u'0.40')
expected = (1000, Decimal('10.00'), Decimal('0.68'))
expected = (1000, Decimal('10.00'), Decimal('0.59'))
assert actual == expected, actual

def test_prep_hit_at_fifty_cents(self):
actual = self.prep(u'0.50')
expected = (1000, Decimal('10.00'), Decimal('0.68'))
expected = (1000, Decimal('10.00'), Decimal('0.59'))
assert actual == expected, actual

def test_prep_hit_at_sixty_cents(self):
actual = self.prep(u'0.60')
expected = (1000, Decimal('10.00'), Decimal('0.68'))
expected = (1000, Decimal('10.00'), Decimal('0.59'))
assert actual == expected, actual

def test_prep_hit_at_eighty_cents(self):
actual = self.prep(u'0.80')
expected = (1000, Decimal('10.00'), Decimal('0.68'))
expected = (1000, Decimal('10.00'), Decimal('0.59'))
assert actual == expected, actual

def test_prep_hit_at_nine_fifteen(self):
actual = self.prep(u'9.15')
expected = (1000, Decimal('10.00'), Decimal('0.68'))
expected = (1000, Decimal('10.00'), Decimal('0.59'))
assert actual == expected, actual

def test_prep_hit_at_nine_thirty_one(self):
actual = self.prep(u'9.31')
expected = (1000, Decimal('10.00'), Decimal('0.68'))
def test_prep_hit_at_nine_forty(self):
actual = self.prep(u'9.40')
expected = (1000, Decimal('10.00'), Decimal('0.59'))
assert actual == expected, actual

def test_prep_hit_at_nine_thirty_two(self):
actual = self.prep(u'9.32')
expected = (1000, Decimal('10.00'), Decimal('0.68'))
def test_prep_hit_at_nine_forty_one(self):
actual = self.prep(u'9.41')
expected = (1000, Decimal('10.00'), Decimal('0.59'))
assert actual == expected, actual

def test_prep_hit_at_nine_thirty_three(self):
actual = self.prep(u'9.33')
expected = (1001, Decimal('10.01'), Decimal('0.68'))
def test_prep_hit_at_nine_forty_two(self):
actual = self.prep(u'9.42')
expected = (1002, Decimal('10.02'), Decimal('0.60'))
assert actual == expected, actual


Expand Down
22 changes: 11 additions & 11 deletions www/about/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ <h2>Details</h2>
<p>Gifts are distributed <b>every Thursday</b>. Gifts come out of your
current balance (the money people have given to you), and if that's not
enough, Gittip can charge your credit card to make up the difference. We
add an additional <b>30&cent; + 3.9%</b> fee when pulling money in from
your credit card, to cover credit card processing (as well as hosting and
other expenses). We also charge you no less than <b>$10</b> at a time, to
minimize credit card processing fees. Any extra remains in your account to
be used next week. Recipients get the <b>full face value</b> of your gift
to them. If you give someone $3, they will have $3 in their Gittip account
every Thursday until you run out of money.</p>
add an additional <b>30&cent; + 2.9%</b> fee when pulling money in from
your credit card, to cover credit card processing. We also charge you no
less than <b>$10</b> at a time, to minimize credit card processing fees.
Any extra remains in your account to be used next week. Recipients get the
<b>full face value</b> of your gift to them. If you give someone $3, they
will have $3 in their Gittip account every Thursday until you run out of
money.</p>

<p>For example, let's say that you have $2.00 in your account, and
you are set up to give $1.00 each to 20 people. Here's what we will
Expand All @@ -51,17 +51,17 @@ <h2>Details</h2>
&nbsp;<b>$18.00&nbsp;&nbsp;&nbsp;amount needed</b><br />
<u>+$&nbsp;0.30</u>&nbsp;&nbsp;&nbsp;fee<br />
&nbsp;$18.30<br />
<u>x&nbsp;&nbsp;1.039</u>&nbsp;&nbsp;fee<br />
&nbsp;<b>$19.02&nbsp;&nbsp;&nbsp;amount to charge</b><br />
<u>/&nbsp;&nbsp;&nbsp;.971</u>&nbsp;&nbsp;fee<br />
&nbsp;<b>$18.85&nbsp;&nbsp;&nbsp;amount to charge</b><br />
<u>-$18.00</u>&nbsp;&nbsp;&nbsp;<br />
&nbsp;$&nbsp;1.02&nbsp;&nbsp;&nbsp;total fee<br />
&nbsp;$&nbsp;0.85&nbsp;&nbsp;&nbsp;total fee<br />
</p>

<p>Participants in the U.S. can <a
href="https://www.gittip.com/bank-account.html">connect a bank
account</a> to have funds <a
href="http://blog.gittip.com/post/30116848405/with-payouts-gittip-is-minimally-viable">deposited
weekly</a> (less a $0.30 fee). It takes one business day for deposits
weekly</a> (less a $0.25 fee). It takes one business day for deposits
to clear, so generally they will <b>clear on Friday</b>. We're
working on automated payouts <a
href="https://github.com/gittip/www.gittip.com/issues/126">outside the
Expand Down

0 comments on commit 20b5fa0

Please sign in to comment.