SEP: 0004
Title: Tx Status Endpoint
Author: stellar.org
Status: Final
Created: 2017-10-30
Simple way to get the status of a payment that has been sent through the compliance protocol from the receiver.
In many cases the sender needs to get additional info from the receiver after the payment is sent. To either tell their customer or for their own records.
After a tx is approved by the compliance protocol and submitted to Stellar, the sender can call /tx_status
to learn
what happened to the tx.
Endpoint at the URL specified by AUTH_SERVER
in the stellar.toml file of an institution that receives payments. This
endpoint is used to relay the status of payments to the sender or other interested parties. Can be used for simple
informational purposes or to convey a code needed by the individual to claim the money on the receiving end.
AUTH_SERVER/tx_status?id=tx_id
return
{
status: <status code see below>,
recv_code: <arbitrary string>,
refund_tx: <tx_hash>,
msg: <arbitrary string>
}
id
The Stellar transaction ID of of the payment we are interested in.
refund_tx
only appears if the status is "refunded". It will be the txID of the tx sending the money back. The address
to send the refund to needs to be sent as part of the original payment attachment otherwise the receiver won't know how
to refund.
status
is one of the following codes:
unknown
- what money?approved
- payment was approved by the receiving FI but the Stellar transaction hasn't been received yet.not_approved
- Stellar transaction was found but it was never approved by the receiving FI.pending
- payment was received. we are attempting to deposit it. This also covers scenarios where something could not be deposited via the default method, but may be deposited by another method (i.e. electronic deposit failed, but it may be deposited manually and it will take longer)failed
- we could not deposit it.msg
should contain more info.refunded
- payment was sent back to sending FI. Possible reasons: deposit could not be made, or sending FI decided to cancel the cash pick-up payment (sometimes recipient never picks it up).claimable
- Mostly used for cash pickup. Cash is ready to be picked up at specified locationsdelivered
- Receiver should now have the funds, cash has been picked up, or money has been deposited into the bank account.
Prior discussion was done here stellar-deprecated/bridge-server#59
Current steps in a payment that goes through the compliance protocol:
- Alice initiates a payment to bob*bankb.com
- Client Endpoint A handles request
- Client Endpoint debits Alice's account
- Client Endpoint A call Bridge A
- Bridge A calls Compliance A
- Compliance A loads the stellar.toml B
- Compliance A resolves bob*bankb.com from federation server B
- Compliance A crafts the stellar tx
- Compliance A calls Compliance B
- Compliance B checks sanctions and other things
- Compliance B replies to Compliance A
- Compliance A replies to Bridge A with the stellar tx.
- Bridge A submits the stellar tx to horizon A
- horizon A submits the tx to stellar-core A
- Stellar network does its thing
- horizon B sees the tx applied to the ledger
- bridge B receives the applied tx to the ledger
- bridge B checks with Compliance B to verify that the tx was approved
- bridge B calls receive hook B to finish the payment
- Receive hook B credits bob's account
- Receive Hook notifies Bob
- Bob has been paid.