-
Notifications
You must be signed in to change notification settings - Fork 308
Conversation
12eca87
to
b9ad650
Compare
Mispayments are kinda tricky. We have three options - # 1: accept all mispayments and add them to the user's balanceWe do receive a callback everytime a mispayment is made. Coinbase's UI will always show something like ^^ though, so it might be weird if we just silently ignored the problem and credited the user's account. Maybe send an email with details?
Under the hood, this will make stuff a bit complicated though. We link every # 2: refund all mispayments as soon as we receive themWe'd have to collect a refund address from the user for this. This isn't required for someone with a coinbase account, but that's unlikely - people who have a coinbase account would pay using coinbase, which would never cause a mispayment to happen in the first place. Should we ask the user to add a bitcoin address to his profile before he can make a bitcoin payin? # 3: Don't do anything, handle through support.Even though these are edge cases, EDIT: I've proceeded with a simple error message that says "contact support" for now. The coinbase iframe also shows a similar message. |
2408728
to
7e06d0e
Compare
c8a18f1
to
f3a42a1
Compare
Notes on deployment:
|
|
||
status = order['status'] | ||
|
||
# We're ignoring mispayments/expired orders here. |
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.
It doesn't seem very wise to completely ignore errors.
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.
Expired orders don't matter to us at all, but we could do more with mispayments.
We do show client side error messages like shown in the last screenshot in #3317 (comment). Does sending an email sound good to you? The other options are listed in #3317 (comment), I think they're unnecessary and too much of work for now.
I don't like the changes you've made to |
( SELECT r.*::exchange_routes | ||
FROM exchange_routes r | ||
WHERE r.id = e.route | ||
) AS route |
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.
Not very important, but the indentation is inconsistent here.
What if we want to record an exchange that we know is successful? Would we have to call And |
This prevents mispayments (after an order is complete) from modifying one's balance.
Is there a diagram or an algorithm about what's going on (mispayment etc.)? |
@techtonik - No, there isn't. I can explain a bit though. When a user clicks 'pay' on the
For each of these cases, we receive a callback at Case 2 (expiry) isn't a problem for us, the user probably didn't intend to pay at all. Case 3 is tricky, as mentioned in #3317 (comment). We just show the user an error message (coinbase does the same in the iframe) that asks them to contact support to retrieve the mispaid bitcoin. Refunding the mispaid bitoin is something that one of us (only @whit537 for now, see #2178) can do through Coinbase's UI. |
Either that or modify
No, that's not what it's doing. Although it's not implemented it is possible to do payins via |
…ll routes" This reverts commit c7222ae.
|
||
# If not, create one. | ||
if not isinstance(route, ExchangeRoute): | ||
route = ExchangeRoute.insert(participant, 'coinbase-payin', order['id']) |
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.
That's a race condition. You should try the insert
first, and do the from_address
if you get an IntegrityError
.
We're dropping bitcoin, closing this. |
#1963
Handle mispayments - overpaid, underpaid.Skip for now, handle via support.