Derived from model/model.yaml. The customer-payments service is built on develop (IQVO/customer-payments at 054b3de, checked 2026-12-02), released at v0.1.4 and applied to the k3s cluster: the api and the A2A agent are deployed, the MCP server is registered in warehouse-infra and switched off. Every Err... name, REST route and CloudEvents type of this context named on this page exists in the service; where the built service differs from the model's design, the page says so (As built) or the context's Service and operations section lists it.
Every event this context publishes and consumes, from
contexts[customer-payments].publishes and .consumes, with the producer's
entry for each consumed event. The domain-wide rules are on
Event standard: CloudEvents.
as builtretailnetwork.customer-payments.events for every event (service ADR 0003, TopicEvents in internal/adapters/outbound/kafka/payloads.go); there is no .analytics topic. Every published event is still analytics-only (no integration consumer), so this departs from conventions.integration_rules, which routes analytics-only events to .analytics
Kafka key
the subject: authorizationId for authorization events, refundId for refund events, so one aggregate's events stay on one partition and in order
No payment event carries a card number, a PSP token or any shopper data: the
payloads hold ids, amounts, reasons and timestamps only
(meta.hard_boundary).
Every event is written to outbox_events in the same transaction as the
aggregate save, and a relay publishes it. All eight events name their
consumers as "analytics only" by design: they go to the .analytics topic and no
storefront or network context subscribes to a payment fact
(Context Map).
ReleaseAllocation (ReleaseOnCancellation on FulfillmentCancelled, ReleaseOnUnsourceable on FulfillmentUnsourceable) or VoidAuthorization (reason VOIDED)
Consumers
analytics only (the future customer-notifications context would consume it)
Field
Type
Meaning
authorizationId
string
The authorization the allocation belongs to.
orderId
string
The order bound to it.
groupNo
integer
The group whose allocation was released.
amountMinor
integer
The released amount in minor units.
reason
string
Why it was released: CANCELLED, UNSOURCEABLE, VOIDED or EXPIRED.
AuthorizePayment (declined by the provider; the DECLINED record is saved), or ReauthorizePayment (reason REAUTH_DECLINED; the authorization moves to EXPIRED)
Consumers
analytics only
Field
Type
Meaning
authorizationId
string
The authorization record (the DECLINED row for a declined authorize).
checkoutSessionId
string
The session whose authorize was declined; it stays open for another token.
reason
string
The decline reason, translated by the ACL, or REAUTH_DECLINED.
Every consumer is idempotent on the CloudEvents id: the id is inserted
into processed_events in the same transaction as the effect, and a
duplicate is acknowledged without effect. Consumers dispatch on the full
type string, never on a suffix. Consumer group names come from mandatory environment variables (CHECKOUT_CONSUMER_GROUP, ORDER_SOURCING_CONSUMER_GROUP, SHIPPING_AND_TRACKING_CONSUMER_GROUP; the service refuses to start without them); the names the design suggests:
customer-payments.checkout, customer-payments.order-sourcing,
customer-payments.shipping-and-tracking.
From checkout (retailnetwork.checkout.events, Customer/Supplier)
Runs CaptureOnShipment: captures that group's allocation (PaymentCaptured) and stores the tracking number on the group's allocation. Parked if the order is not yet bound.
Runs RefundOnReturnToSender: refunds the affected group's captured amount (found by tracking number), reason RETURNED_TO_SENDER. Parked if the order is not yet bound.
Ordering. The three topics have no order between them (gap S4).
CheckoutCompleted is keyed by sessionId upstream, FulfillmentShipped,
FulfillmentCancelled and FulfillmentUnsourceable by the assignment, and PackageLost and
PackageReturned by the tracking number, so nothing links an order's facts
across topics. A fact whose orderId is not bound to an authorization yet
is stored in ParkedFulfillmentFacts and applied on the bind; the inbox on
the CloudEvents id makes a redelivery safe, and the aggregate refuses what
the state does not allow (ErrOverCapture, ErrCaptureAfterExpiry,
ErrOverRefund). Parked facts are retained 30 days and then
purged, and a gauge reports the parked count, so an order that never binds
cannot grow the table without bound.
No card number, token or shopper reference appears in any payment event:
the events carry ids and amounts only, and the PSP token never leaves the
provider port (conventions.no_auth — the storefront stores no PII).