Gateway Configuration Activated
A gateway configuration of a recipient became active, born active or activated once the vendor returned the subaccount: the configuration with its recipient, capture channel and vendor. Recorded by cna-pay in its outbox in the transaction of the activation. No consumer yet.
The name is decided (cna-pay-docs, Ata 2026-10-17, decision 11); the aggregate root, the key, the version and the fields are provisional, chosen by the Pay engineering until cna-pay-docs decides how the events of cna-pay reach this catalog (cna-br/cna-pay#343). If the catalog puts the configuration on the Recipient topic, the root becomes Recipient and the key recipientId; whether the payload adds the payment methods and the creation instant is open too.
Overview
Fact: a GatewayConfigurationGatewayConfigurationEntityv1.0.0A gateway configuration of CNA Pay - which subaccount, at which payment vendor, serves a recipient in a capture channel,...Ownercna-platformView docs of a RecipientRecipientEntityv1.0.0A recipient (recebedor) of CNA Pay - every CPF or CNPJ enabled to receive money on the platform - a school, the franchis...Ownercna-platformView docs became ACTIVE (cna-pay-docs RN-EVT-110; PRD 1, section 6). The payload is the configuration after its activation, after eventId and objectVersion: its id, its recipientId, its captureChannel, the vendor of its subaccount, its state, always ACTIVE here, and activatedAt.
When it is published. CNA PayCNA PayServicev1.0.0Payments platform of the CNA network (recipients, their subaccounts at the payment vendor, bank accounts and gateway con...PublishesRecipientCreated, RecipientStateChanged +5Ownercna-platformMapRepoView docs records it in its outbox, in the transaction of the activation, for the master system of the recipient. The publisher process then sends it to GatewayConfiguration (Kafka topic)GatewayConfiguration (Kafka topic)Channelv1.0.0Kafka topic for the GatewayConfiguration aggregate of CNA Pay - which subaccount at which payment vendor serves a recipi...Ownercna-platformView docs. A configuration becomes active in two ways:
- Born active.
configureGatewaycreates itACTIVEwhen the vendor has already returned the subaccount of the recipient, even blocked: the One configures a school and the back office of the platform the franchisor, in theONLINEchannel. ItsobjectVersionis 1. - Activated with no command. A configuration born
IN_VALIDATION, while the subaccount was being created, becomesACTIVEin the transaction that records the subaccount the vendor returned,ACTIVEorBLOCKED, with its version incremented. A configuration waiting in a channel where the recipient already has an active one is the new configuration of a cutover and staysIN_VALIDATION.
An active configuration is not eligibility: whether the recipient takes payments is the eligibility its own facts carry on Recipient (Kafka topic)Recipient (Kafka topic)Channelv1.0.0Kafka topic for the Recipient aggregate of CNA Pay - every CPF or CNPJ enabled to receive money on the platform. Carries...Ownercna-platformView docs. objectVersion is the version of the configuration, a stream of its own, not the version of the recipient.
No consumer yet. The One is the expected first consumer. Delivery is at least once: a consumer drops an event whose eventId it already applied and a state older than the objectVersion it holds. cna-pay publishes nothing until this message is in the catalog (see GatewayConfiguration (Kafka topic)GatewayConfiguration (Kafka topic)Channelv1.0.0Kafka topic for the GatewayConfiguration aggregate of CNA Pay - which subaccount at which payment vendor serves a recipi...Ownercna-platformView docs).
Kafka
Topic (AggregateRoot) | GatewayConfiguration |
Message key (RoutingKey) | payload.id |
| Contract owner | PAY |
metadata.event | GatewayConfigurationActivated |
| Consumer group | (none yet) |
Payload schema
Source of truth
events.Fact (shown on Recipient CreatedRecipient CreatedEventv1.0.0The platform recorded a new recipient: its public state at its birth, ACTIVE and neither transacting nor withdrawing whi...Ownercna-platformSchemaMapView docs) is embedded first, without a JSON name, so eventId and objectVersion are written inline before the fields of the configuration. ActivatedAt is written by dates.ISO, in UTC with milliseconds; the channel and the state are the names of the enums of the configuration (ONLINE, ACTIVE), and the vendor its stable lowercase name (pagarme).
type ActivatedPayload struct { events.Fact
ID uuid.UUID `json:"id"` RecipientID uuid.UUID `json:"recipientId"` CaptureChannel string `json:"captureChannel"` Vendor string `json:"vendor"` State string `json:"state"` ActivatedAt string `json:"activatedAt"`}
var GatewayConfigurationActivated = events.Definition[ActivatedPayload]{ Name: "GatewayConfigurationActivated", Owner: events.OwnerPay, AggregateRoot: "GatewayConfiguration", Version: "1.0.0", RoutingKey: func(p ActivatedPayload) string { return p.ID.String() },}The definition exists only in cna-pay.
Custom properties
| Property | Value |
|---|---|
| Contract Ownerx-contract-owner | PAY |
| Kafka Topicx-kafka-topic | GatewayConfiguration |
| Message Keyx-message-key | id |
| Sourcex-source | cna-pay api/internal/platform/events/pay/gatewayconfiguration/gateway_configuration_activated.go |
Unique, immutable id of the event (events.Fact), the same in every resend of it. A consumer drops an event whose eventId it already applied.
Version of the gateway configuration after the change the event reports, from 1 (events.Fact): a stream of its own, apart from the version of the recipient. A consumer drops a fact older than the version it holds.
1Id of the gateway configuration in cna-pay. Kafka message key.
Id of the recipient the configuration belongs to, the id of the Recipient topic.
Capture channel the configuration serves: ONLINE (remote charge) or TERMINAL (payment terminal, not configured in this delivery). A recipient has at most one ACTIVE configuration per channel (RN-RCB-080).
ONLINE TERMINALStable name of the payment vendor of the subaccount the configuration points to, lowercase: pagarme, the only vendor today.
^[a-z][a-z0-9_]{0,31}$State of the configuration after the change (cna-pay gateway configuration state): always ACTIVE in this event.
IN_VALIDATION ACTIVE CLOSEDWhen the configuration became ACTIVE: ISO 8601 in UTC with milliseconds (2026-11-18T12:00:00.000Z).