-
Notifications
You must be signed in to change notification settings - Fork 308
Add tests for payday behavior when balance is negative #4255
Conversation
41915d8
to
21ca286
Compare
21ca286
to
68e36a2
Compare
I think that has implications for people who would've received from these people, though. A → B We double-pay B and send their balance negative to correct. Next week they receive from A again, but that just brings them up to 0 and they don't have enough to pay C. Sorry, C. :-( |
Or can we be smart enough to charge if the net for the payday is positive? Seems like we should be able to. |
This is complicated because |
One possibility would be to floor |
Alright, this is non-trivial. |
Spurious build failures? Restarted ... |
Rebased, was 68e36a2. |
68e36a2
to
e9a3b66
Compare
e9a3b66
to
0015f4b
Compare
Ping @mattbk @nobodxbodon @kaguillera I think this should be an easy one to review, because it only touches tests. |
Withdrawing from review. Tests are failing and it's not obvious to me why. |
Giving up. 😞 |
In limited situations, we send a participant's Gratipay escrow balance negative. For example, when they receive stolen money that we refund (https://github.com/gratipay/violations/issues/34), or when I forget to post back MassPay and subsequently overpay people (gratipay/inside.gratipay.com#951). In these situations, we want to recoup the loss from future takes, but our current behavior is to charge their credit card (if they have one) to make up the difference. That penalizes the participant for a mistake on our part, so I think the best thing to do is update payday to not charge a card when a pre-payday balance is negative.
Update: We ended up working around the charges for the 10 people in question by manually overriding the
error
field on their route to prevent charging. The tests on this PR are still valuable as documentation of existing behavior.