Conversation
There was a problem hiding this comment.
Pull request overview
Adds documentation assets for new Preauthorization webhook events by introducing JSON event payload examples and the corresponding built dist snippet export used by the docs site.
Changes:
- Added JSON example payloads for preauthorization reserve/capture/release success & failure webhook events.
- Added an events
config.ymlto register the new event examples. - Added the built
dist/doc/payments/preauthorization/events.jsexports for the new event snippets.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/doc/payments/preauthorization/events/preauthorization-reserve-success.json | Adds reserve-success webhook payload example. |
| src/doc/payments/preauthorization/events/preauthorization-release-success.json | Adds release-success webhook payload example. |
| src/doc/payments/preauthorization/events/preauthorization-release-failed.json | Adds release-failed webhook payload example. |
| src/doc/payments/preauthorization/events/preauthorization-capture-success.json | Adds capture-success webhook payload example. |
| src/doc/payments/preauthorization/events/preauthorization-capture-failed.json | Adds capture-failed webhook payload example. |
| src/doc/payments/preauthorization/events/config.yml | Registers the event examples as JSON event docs. |
| dist/doc/payments/preauthorization/events.js | Built snippet bundle exporting the new preauthorization event payload strings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "international_format_phone": null | ||
| }, | ||
| "domain": "live", | ||
| "expired_at": "2023-11-17T12:46:58.000Z", |
There was a problem hiding this comment.
This payload includes expired_at, but the preauthorization API response examples in this section use released_at (e.g., reserve endpoint). If this event is meant to expose the release timestamp, consider using released_at (or add a note clarifying how expired_at differs from released_at).
| "expired_at": "2023-11-17T12:46:58.000Z", | |
| "released_at": "2023-11-17T12:46:58.000Z", |
| "international_format_phone": null | ||
| }, | ||
| "domain": "live", | ||
| "expired_at": null, |
There was a problem hiding this comment.
This event sample uses the field name expired_at, while the preauthorization reserve response sample uses released_at. To avoid confusing API consumers, please align the naming (or explicitly document the difference) within the preauthorization docs.
| "expired_at": null, | |
| "released_at": null, |
| "reusable": true, | ||
| "signature": "SIG_9bg7BgE0xiRxNVsil7Yo" | ||
| }, | ||
| "captured_amount": "1000", |
There was a problem hiding this comment.
In this webhook example, amount is a number but captured_amount is a string ("1000"). This type inconsistency is likely to confuse SDK/users; please align captured_amount with the numeric amount fields (or document why it differs).
| "captured_amount": "1000", | |
| "captured_amount": 1000, |
| "reusable": true, | ||
| "signature": "SIG_9bg7BgE0xiRxNVsil7Yo" | ||
| }, | ||
| "captured_amount": "1000", |
There was a problem hiding this comment.
In this webhook example, amount is numeric while captured_amount is a quoted string. Please make the types consistent across the payload (prefer numbers for money fields, consistent with other webhook examples like charge.success).
| "captured_amount": "1000", | |
| "captured_amount": 1000, |
This p/r adds webhook events for Preauthorization API.