-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add withdrawal support for notify_refund_pending RPC method #1353
Conversation
Code Coverage
|
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.
The code looks good although we should update the Platform API tests to cover the new flows.
platform/src/main/java/org/stellar/anchor/platform/rpc/NotifyRefundPendingHandler.java
Show resolved
Hide resolved
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.
LGTM with some minor comments.
@@ -27,7 +27,8 @@ import org.stellar.anchor.platform.AbstractIntegrationTests | |||
import org.stellar.anchor.platform.TestConfig | |||
import org.stellar.anchor.util.GsonUtils | |||
|
|||
@Disabled | |||
@Disabled // TODO: https://stellarorg.atlassian.net/browse/ANCHOR-693 |
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.
Can we put a little details here so that we don't need to go back to the ticket?
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.
Agree, let's do this little TODOs later on to not forget things that were put away!
Description
Add support for withdrawals for existing
notify_refund_pending
RPC methodContext
I noticed refunds are not available for
pending_user_transfer_complete
andpending_external statuses
.Generally speaking, in the regular flow transaction goes from
pending_user_transfer_start
->pending_anchor
->completed
However, when the anchor takes times to process a transaction and it's still in
pending_anchor
, user wants to refund it and can do so.In the cases where status is
pending_user_transfer_complete
(funds are available for pickup) orpending_external
(funds are processed by external entity) we want to fist move it topending_anchor
to indicate that funds are not available for pickup anymore, (or that bank transfer was cancelled), i.e. indicate that refund has been initiated.In this case, if we have issues with Stellar transfer or Circle, etc. transaction won't be in status that shows user wrong information. (Especially in
pending_user_transfer_complete
case, where user funds is technically no longer available for pickup anymore, but status doesn't show that)After that, we can use existing
notify_refund_send
RPC.Testing
./gradlew test
Documentation
Flow charts should be updated (https://stellarorg.atlassian.net/browse/ANCHOR-688)
Known limitations
N/A