Skip to content

Commit

Permalink
improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNe0x1 committed Dec 10, 2024
1 parent 4261269 commit 4e5f052
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions docs/payments/integrate/widget.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,24 @@ It will perform 25 retries over approx. 21 days.

:::

:::warning

To ensure reliable integration with DePay, design your system to avoid race conditions that could arise from out-of-order events and callbacks.

:::

:::caution

Payment callbacks are assigned the highest priority in DePay's processing queue. Events such as attempt, processing, and succeeded/failed are processed independently. Consequently, a payment callback may arrive in a different order than the events you have already received. It is crucial to ensure your implementation avoids race conditions or dependencies on a specific sequence of events and payment callbacks, as their order is not guaranteed.

:::

:::caution

Payment events are processed independently, so their delivery order is not guaranteed. This behavior is particularly relevant when considering the retry mechanism: a single event may be re-delivered out of sequence if your backend fails to respond with a 200 status. For example, an "attempt" event might be requeued due to a failed delivery attempt, while a subsequent "processing" event is successfully delivered and processed first. The original "attempt" event may then arrive after the "processing" event.

:::

## Verify communication

Copy the public key provided for your integration (on [app.depay.com](https://app.depay.com)), store and use it in your application to verify all communication from DePay's APIs to your systems is authentic.
Expand Down Expand Up @@ -790,12 +808,6 @@ sequenceDiagram
Widget->>App: release user
```

:::caution

Payment callbacks are assigned the highest priority in DePay's processing queue. Events such as attempt, processing, and succeeded/failed are processed independently. Consequently, a payment callback may arrive in a different order than the events you have already received. It is crucial to ensure your implementation avoids race conditions or dependencies on a specific sequence of events and payment callbacks, as their order is not guaranteed.

:::

### Failed payment

Only differs to a [successful payment](#successful-payment) in regards of the validation result and everything happening after.
Expand Down

0 comments on commit 4e5f052

Please sign in to comment.