Skip to content

Comments

Feat/add preauth events#124

Open
Andrew-Paystack wants to merge 3 commits intomainfrom
feat/add-preauth-events
Open

Feat/add preauth events#124
Andrew-Paystack wants to merge 3 commits intomainfrom
feat/add-preauth-events

Conversation

@Andrew-Paystack
Copy link
Collaborator

This p/r adds webhook events for Preauthorization API.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml to register the new event examples.
  • Added the built dist/doc/payments/preauthorization/events.js exports 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",
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
"expired_at": "2023-11-17T12:46:58.000Z",
"released_at": "2023-11-17T12:46:58.000Z",

Copilot uses AI. Check for mistakes.
"international_format_phone": null
},
"domain": "live",
"expired_at": null,
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"expired_at": null,
"released_at": null,

Copilot uses AI. Check for mistakes.
"reusable": true,
"signature": "SIG_9bg7BgE0xiRxNVsil7Yo"
},
"captured_amount": "1000",
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
"captured_amount": "1000",
"captured_amount": 1000,

Copilot uses AI. Check for mistakes.
"reusable": true,
"signature": "SIG_9bg7BgE0xiRxNVsil7Yo"
},
"captured_amount": "1000",
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
"captured_amount": "1000",
"captured_amount": 1000,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant