-
Notifications
You must be signed in to change notification settings - Fork 11
docs: sync documentation with SCA schema changes #701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,6 +121,7 @@ A single `status` field represents whether the transaction reached its destinati | |
| | Status | Description | | ||
| |--------|-------------| | ||
| | **PENDING** | Quote is pending confirmation | | ||
| | **PENDING_AUTHORIZATION** | Awaiting Strong Customer Authentication. Only occurs for customers in regions where SCA is required (e.g., EU); authorize the transaction's `scaChallenge` to proceed. | | ||
| | **EXPIRED** | Quote wasn't executed before the expiry window | | ||
| | **PROCESSING** | Executing the quote after receiving funds (checking internal balances, or push/pull to/from external account) | | ||
| | **COMPLETED** | Payout successfully reached the destination account | | ||
|
|
@@ -135,6 +136,9 @@ A single `status` field represents whether the transaction reached its destinati | |
| ```mermaid | ||
| stateDiagram-v2 | ||
| [*] --> PENDING : Quote created | ||
| PENDING --> PENDING_AUTHORIZATION : SCA required (EU) | ||
| PENDING_AUTHORIZATION --> PROCESSING : Authorized | ||
| PENDING_AUTHORIZATION --> EXPIRED : Challenge expired | ||
| PENDING --> PROCESSING : Quote confirmed, funds received | ||
| PENDING --> EXPIRED : Quote expired before execution | ||
| PROCESSING --> COMPLETED : Payout reached destination | ||
|
|
@@ -190,6 +194,7 @@ Outgoing payment webhooks use the format `OUTGOING_PAYMENT.<STATUS>`. The webhoo | |
| | Event | Description | | ||
| |-------|-------------| | ||
| | `OUTGOING_PAYMENT.PENDING` | Transaction created, quote pending confirmation | | ||
| | `OUTGOING_PAYMENT.PENDING_AUTHORIZATION` | Awaiting Strong Customer Authentication (EU customers only) | | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The Example Payloads tabs include PENDING, COMPLETED, FAILED, and REFUND_COMPLETED, but there is no tab for Context Used: mintlify/AGENTS.md (source) Prompt To Fix With AIThis is a comment left during a code review.
Path: mintlify/platform-overview/core-concepts/transaction-lifecycle.mdx
Line: 197
Comment:
**Missing webhook payload example for `PENDING_AUTHORIZATION`**
The Example Payloads tabs include PENDING, COMPLETED, FAILED, and REFUND_COMPLETED, but there is no tab for `PENDING_AUTHORIZATION`. Without a concrete payload example, developers cannot see what fields (e.g., `quoteId`, `scaChallenge`) are available in the webhook body — which is critical for knowing how to retrieve the SCA challenge and call `POST /quotes/{quoteId}/authorize`.
**Context Used:** mintlify/AGENTS.md ([source](https://app.greptile.com/lightspark/github/lightsparkdev/grid-api/-/custom-context?memory=51934046-75fb-42d3-9870-f42d61cb60e3))
How can I resolve this? If you propose a fix, please make it concise. |
||
| | `OUTGOING_PAYMENT.PROCESSING` | Quote confirmed, payout in progress | | ||
| | `OUTGOING_PAYMENT.COMPLETED` | Payout reached destination | | ||
| | `OUTGOING_PAYMENT.FAILED` | Payout failed | | ||
|
|
@@ -270,6 +275,11 @@ app.post('/webhooks/grid', async (req, res) => { | |
| const { data, type } = req.body; | ||
|
|
||
| switch (type) { | ||
| case 'OUTGOING_PAYMENT.PENDING_AUTHORIZATION': | ||
| // EU customers only: prompt user to complete SCA challenge | ||
| await notifyCustomer(data.customerId, 'Authorization required to complete payment.'); | ||
| break; | ||
|
|
||
| case 'OUTGOING_PAYMENT.COMPLETED': | ||
| await notifyCustomer(data.customerId, 'Payment delivered!'); | ||
| break; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scaChallengelives on the quote, not the transactionThe description says "authorize the transaction's
scaChallenge", but the only authorize endpoint documented isPOST /quotes/{quoteId}/authorize, and thescaChallengeobject is shown on the quote response (inquote-system.mdx). A developer who receives anOUTGOING_PAYMENT.PENDING_AUTHORIZATIONwebhook has a transaction ID, not a quote ID — the status table should either reference the quote'sscaChallengeand mention using thequoteIdfield, or a webhook payload example for this event should be added showing how to obtain the quote ID needed to call/quotes/{quoteId}/authorize.Prompt To Fix With AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude fix this one.