event

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.

Event Topic: GatewayConfigurationKey: idNo consumer
Provisional topic, key and fields

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. configureGateway creates it ACTIVE when 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 the ONLINE channel. Its objectVersion is 1.
  • Activated with no command. A configuration born IN_VALIDATION, while the subaccount was being created, becomes ACTIVE in the transaction that records the subaccount the vendor returned, ACTIVE or BLOCKED, 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 stays IN_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 ownerPAY
metadata.eventGatewayConfigurationActivated
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).

api/internal/platform/events/pay/gatewayconfiguration/gateway_configuration_activated.go
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

PropertyValue
Contract Ownerx-contract-ownerPAY
Kafka Topicx-kafka-topicGatewayConfiguration
Message Keyx-message-keyid
Sourcex-sourcecna-pay api/internal/platform/events/pay/gatewayconfiguration/gateway_configuration_activated.go
8 properties
eventIdstring<uuid>
required

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.

objectVersioninteger
required

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.

Minimum: 1
idstring<uuid>
required

Id of the gateway configuration in cna-pay. Kafka message key.

recipientIdstring<uuid>
required

Id of the recipient the configuration belongs to, the id of the Recipient topic.

captureChannelstring
required

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).

Allowed values: ONLINE TERMINAL
vendorstring
required

Stable name of the payment vendor of the subaccount the configuration points to, lowercase: pagarme, the only vendor today.

Match pattern: ^[a-z][a-z0-9_]{0,31}$
statestring
required

State of the configuration after the change (cna-pay gateway configuration state): always ACTIVE in this event.

Allowed values: IN_VALIDATION ACTIVE CLOSED
activatedAtstring<date-time>
required

When the configuration became ACTIVE: ISO 8601 in UTC with milliseconds (2026-11-18T12:00:00.000Z).