Repository navigation
feat(MER-155): Open Payments webhook on the management API - #19
Merged
Merged
Conversation
koekiebox
approved these changes
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the webhook that tells the Merchant API a card payment has completed. With the finalize endpoint (#17), the terminal approves, the Merchant API creates the outgoing payment, and this webhook is how the Merchant API learns that the money arrived.
sequenceDiagram participant POS participant MerchantAPI as Merchant API participant OP as Open Payments provider (Rhyza) POS->>MerchantAPI: POST /v1/transactions/{requestId}/finalize (approve) MerchantAPI->>OP: create outgoing payment OP-->>MerchantAPI: POST /v1/webhooks/open-payments (payment_intent.completed) MerchantAPI-->>POS: 200 completedHow the Merchant API answers:
"A payment to complete" includes a transaction whose outgoing payment creation the Merchant API reported as failed: a timed-out create may still have made the payment.
Anything that isn't ours gets
204, because the provider does not retry a 4xx and its webhook URL may receive other events.Evidence
oapi-codegenon the admin spec generates no webhook operation (grep -c receiveOpenPaymentsWebhook admin/server.gen.go→0).After: it generates
ReceiveOpenPaymentsWebhook(28 matches), and the Merchant API implementation against it passes its suite (interledger/merchant-api PR, linked from there).Merge Danger
Door: two-way
Additive: one new path, one response, two schemas. Nothing existing changes.
Blast Radius: none
No existing consumer calls this path.
metadatais left untyped on purpose, because providers put arbitrary JSON there.