feat(spec): add INCOMING_PAYMENT.PROCESSING to the webhook contract - #858
feat(spec): add INCOMING_PAYMENT.PROCESSING to the webhook contract#858shreyav wants to merge 1 commit into
Conversation
WebhookType describes itself as dot-notation that "lets consumers route purely on type without inspecting data.status". The incoming family breaks that promise: it has no PROCESSING event, so sparkcore's _get_incoming_webhook_type collapses CREATED, PENDING, PROCESSING and SENT onto INCOMING_PAYMENT.PENDING, while the outgoing equivalent gives PROCESSING its own event. A pull into an internal account therefore fires PENDING twice, and the second payload carries status PROCESSING inside an envelope typed PENDING — exactly the inspect-data.status case the contract says consumers should not need. Adds the value to WebhookType and to the IncomingPaymentWebhook type enum, mirroring the outgoing family. Contract only: sparkcore does not emit the event yet, and its WebhookType is generated from this spec, so this has to land before the emission fix can reference the new member. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TxsyZEDjQDt97rR3kd2kxv
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
✱ Stainless preview builds for gridThis PR will update the cli go kotlin openapi php python ruby typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-typescript studio · code · diff
✅ grid-openapi studio · code · diff
✅ grid-ruby studio · code · diff
✅ grid-go studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-python studio · code · diff
✅ grid-php studio · code · diff
✅ grid-cli studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
Greptile SummaryAdds
Confidence Score: 5/5The PR appears safe to merge because the additive event value is consistently represented across the authoritative schemas and generated bundles. The shared webhook registry and incoming-payment payload enum remain aligned, no additional discriminator or registry requires updating, and the generated contracts mirror the modular source.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/webhooks/WebhookType.yaml | Adds the processing event to the authoritative shared webhook type registry. |
| openapi/components/schemas/webhooks/IncomingPaymentWebhook.yaml | Adds the same event to the incoming-payment webhook's narrowed type enum. |
| openapi.yaml | Correctly mirrors both source-schema additions in the generated bundled contract. |
| mintlify/openapi.yaml | Keeps the Mintlify contract bundle synchronized with the generated root contract. |
Reviews (1): Last reviewed commit: "feat(spec): add INCOMING_PAYMENT.PROCESS..." | Re-trigger Greptile
Note
Bottom of a three-PR stack, based on
mainand mergeable on its own. #856 and #857 sit on top of it. Deliberately isolated so the sparkcore fix that depends on this enum isn't blocked behind the docs work above.The bug
WebhookTypedescribes itself as dot-notation that "lets consumers route purely on type without inspectingdata.status".The incoming family breaks that promise.
_get_incoming_webhook_type(sparkcore/grid/webhooks/webhook_handler.py:142) collapses four states onto one event:The outgoing twin 24 lines above maps
PROCESSINGto its own event. So a pull into an internal account firesINCOMING_PAYMENT.PENDINGtwice, and the second payload carries"status": "PROCESSING"inside an envelope typedPENDING— exactly the inspect-data.statuscase the contract says consumers should not need.Likely why it went unnoticed: the receive-operation path (ordinary deposits) does not appear to reach
PROCESSING/SENT, so the collapse was harmless.GK.GRID_INCOMING_TRANSACTION_REFACTORthen routed send operations — which do pass through those states — into this function without extending it.This PR
Contract only. Adds
INCOMING_PAYMENT.PROCESSINGtoWebhookTypeand to theIncomingPaymentWebhooktypeenum, mirroring the outgoing family.sparkcore does not emit the event yet. Its
WebhookTypeis generated from this spec, so this has to land before the emission fix can reference the new member.Follow-up in webdev, after this merges
WebhookType.INCOMING_PAYMENT_DOT_PROCESSINGexists.PROCESSING | SENTout of thePENDINGcase in_get_incoming_webhook_type.SENTbelongs withPROCESSING, notPENDING—gen_convert_send_op_to_incoming_transactionalready mapsSENTonto statusPROCESSING(transaction.py:891), so that is what makes the envelope agree with its payload.Note for whoever picks that up: it changes behavior for existing integrators, who currently receive two
PENDINGevents and will start receivingPENDINGthenPROCESSING.A smaller instance of the same collapse is out of scope here:
_get_incoming_webhook_typealso foldsEXPIREDintoINCOMING_PAYMENT.FAILED.Validation
make lintmake build+ bundle syncopenapi.yaml/mintlify/openapi.yamlin syncmainGenerated by Claude Code