set the secondary receiver (mozilla) as the fee payer

This commit is contained in:
Andy McKay 2011-12-08 18:19:26 -08:00
Родитель 0b0981f18a
Коммит 7f2877f5a0
2 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -55,6 +55,8 @@ def add_receivers(chains, email, amount, uuid):
# This is only done if there is a chained payment. Otherwise
# it does not need to be set.
'receiverList.receiver(0).primary': 'true',
# Mozilla pays the fees, because we've got a special rate.
'feesPayer': 'SECONDARYONLY'
})
result.update({
'receiverList.receiver(0).email': email,

Просмотреть файл

@ -110,6 +110,15 @@ class TestPayKey(amo.tests.TestCase):
eq_(_call.call_args[0][1]['receiverList.receiver(0).amount'], '10')
eq_(_call.call_args[0][1]['receiverList.receiver(1).amount'], '1.34')
def test_primary_fees(self):
res = paypal.add_receivers((), 'a@a.com', Decimal('1.99'), '123')
assert 'feesPayer' not in res
def test_split_fees(self):
chains = ((30, 'us@moz.com'),)
res = paypal.add_receivers(chains, 'a@a.com', Decimal('1.99'), '123')
eq_(res['feesPayer'], 'SECONDARYONLY')
class TestPurchase(amo.tests.TestCase):