-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add withdrawal support for notify_refund_pending RPC method (#1353)
### Description Add support for withdrawals for existing `notify_refund_pending` RPC method ### Context I noticed refunds are not available for `pending_user_transfer_complete` and `pending_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) or `pending_external` (funds are processed by external entity) we want to fist move it to `pending_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` - Added new test cases ### Documentation Flow charts should be updated (https://stellarorg.atlassian.net/browse/ANCHOR-688) ### Known limitations N/A
- Loading branch information
Showing
10 changed files
with
302 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
api-schema/src/main/java/org/stellar/anchor/api/shared/SepRefunds.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.stellar.anchor.api.shared; | ||
|
||
public interface SepRefunds { | ||
boolean hasRefundPayments(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.