-
Notifications
You must be signed in to change notification settings - Fork 308
implement a flag for paying out Gratipay 1.0 balances #3535
Conversation
aa43f68
to
a7ad836
Compare
There are going to be two ways to resolve a Gratipay 1.0 balance, either we release it, or we refund it. We release it the first payday after someone becomes a team owner, or (now) when we set `pending-payout`. At this point I don't think we'll need a `pending-refund` value. I've changed `{un,}released` to `{un,}resolved` to cover both cases, release and refund. I implemented the status update in Postgres to cover both payday and masspay.
Ready for review, @rohitpaulk, et al. We need this for tomorrow's payday. |
AND network = 'balanced-ba' | ||
) > 0 | ||
FROM exchange_routes r | ||
JOIN participants p ON p.id = r.participant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a user had 4 old bank accounts and 1 active one, wouldn't this result in multiple calls to ach_credit
with the same participant? Maybe changing this to current_exchange_routes
would solve the problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the same bug afflict MassPay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it does - that's a serious bug, we could end up paying people double their balance :/ Here (ach payouts in payday), the worst case scenario is a few extra API calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could end up paying people double their balance
SELECT COUNT(*)
FROM participants p
WHERE (
SELECT COUNT(*)
FROM exchange_routes r
WHERE network='paypal'
AND r.participant = p.id
) > 1; -- returns 0
Hasn't happened till now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think replacing exchange_routes
with current_exchange_routes
in both places should solve the problem.
Blech, forgot the UI for this. :) |
Okay @rohitpaulk, how does it look now? |
Looks good now. |
Okay! I'll let you merge when Travis is green. Diving in on #3538 ... |
implement a flag for paying out Gratipay 1.0 balances
Gah, still forgot the UI for this. :) |
New PR for that: #3542. |
For use on #3481.