From cd9220326b7e6dff9635df0fb1120213053c0b18 Mon Sep 17 00:00:00 2001 From: koekiebox Date: Wed, 15 May 2024 08:18:42 +0200 Subject: [PATCH] feat(2662/2671): document updates. --- .../docs/integration/event-handlers.mdx | 48 ++++++++++++++++--- .../src/content/docs/playground/overview.md | 29 +++++------ 2 files changed, 57 insertions(+), 20 deletions(-) diff --git a/packages/documentation/src/content/docs/integration/event-handlers.mdx b/packages/documentation/src/content/docs/integration/event-handlers.mdx index 36a82f5d77..816e45d94b 100644 --- a/packages/documentation/src/content/docs/integration/event-handlers.mdx +++ b/packages/documentation/src/content/docs/integration/event-handlers.mdx @@ -25,7 +25,9 @@ The `incoming_payment.created` event indicates that an incoming payment has been The `incoming_payment.completed` event indicates that an incoming payment has been completed, either automatically or manually, and that any funds that have been received into this incoming payment should be withdrawn and credited to the recipient's account with the Account Servicing Entity. -Example: An incoming payment was completed and received $10. +In addition, the `CreateIncomingPaymentWithdrawal` supports two-phase transfers [see more](https://en.wikipedia.org/wiki/Two-phase_commit_protocol). + +Example: An incoming payment was completed and received **$10**. +Example: An incoming payment supporting two-phase transfers was completed and recieved **$10**. + +>ASE: webhook event: incoming payment completed,
receivedAmount: $10 + ASE->>R: admin API call: CreateIncomingPaymentWithdrawal + ASE->>ASE: credit receiver's account with $10 + ASE->>R: admin API call: PostLiquidityWithdrawal + R->>R: 2-phase transfer completed + +`} +/> + ## `incoming_payment.expired` The `incoming_payment.expired` event indicates that an incoming payment has expired, and that any funds that have been received into this incoming payment should be withdrawn and credited to the recipient's account with the Account Servicing Entity. Note that this event is not fired if there were no funds received by the incoming payment since there is no action required by the Account Servicing Entity. -Example: An incoming payment has expired and received $2.55. +Example: An incoming payment has expired and received **$2.55**. +Example: An outgoing payment supporting two-phase transfers for **$12** has been completed. **$11.50** were sent. The Account Servicing Entity keeps **$0.50** as fees. + +>ASE: webhook event: outgoing completed,
debitAmount: $12, sentAmount:$11.50 + ASE->>R: admin API call: CreateOutgoingPaymentWithdrawal + ASE->>ASE: remove the hold and deduct $12 from the sender's account,
credit ASE's account with $0.50 + ASE->>R: admin API call: PostLiquidityWithdrawal + R->>R: 2-phase transfer completed + +`} +/> + ## `outgoing_payment.failed` The `outgoing_payment.failed` event indicates that an outgoing payment has either partially or completely failed and a retry was also unsuccessful. The Account Servicing Entity should withdraw any remaining liquidity from that outgoing payment in Rafiki. If the payment failed completely (the `sentAmount` was 0), the Account Servicing Entity should remove the hold from the sender's account. If the payment failed partially, the Account Servicing Entity should remove the hold from the sender's account and debit it with the amount that has been sent, but they should refrain from taking a sending fee. -Example: An outgoing payment for $12 has failed. $8 were sent. +Example: An outgoing payment for **$12** has failed. **$8** were sent.