Requirements
Anchor Platform will send events to theTRANSACTION Kafka topic. The event service will consume events from this topic and send them to the appropriate endpoints.
Configuration
First, the event service’s Kafka producer need to be configured using theevent.queue section of the configuration file or setting the environment variables. The following is the set of required environment variables needed to configure the event service’s Kafka producer:
event_processor section of the Anchor Platform Configuration file or setting the environment variables.
TRANSACTION topic. In this example, the event processor will send events to client and business server callback endpoints.
Receiving Events
The event service can be used to send events to client and business server callback endpoints. The event service will send events to these endpoints as HTTP POST requests with the event data in the request body.As a Client Application
Client applications can receive updates about their users’ transactions and customer information. The schema of the event data will depend on the type of event being sent. To receive events as a client application, you will need to expose callback URLs that the event service can send events to. The event service will send a POST request to this endpoint with the event data in the request body. The schema of the event data will depend on the type of event being sent. Anchor Platform allows unique endpoints to be configured by event type. Anchor Platform will only send events to clients listed in the client configuration. See the client configuration documentation for more information.Callback Signing
Anchor Platform signs the callback requests it sends to client applications. The signature is included in theSignature header of the request. The callback URL signature specification can be found in the corresponding SEP protocol specifications.
As a Business Server
In addition to SEP transaction status updates, business servers can receive events about SEP-31 quote creation or SEP-12 customer information updates. The schema of the event data will depend on the type of event being sent. Visit the Event API documentation for more information about the schema of the event data. To receive events as a business server, you will need to expose a callback URL that the event service can send events to. The event service will send a POST request to this endpoint with the event data in the request body.Configuration
The event service’s callback API can be configured using thecallback_api section of the Anchor Platform configuration file or setting the environment variables.
The following is an example of how to configure the event service’s callback API with JWT authentication:
base_url: The base URL of the business server’s callback endpoint.secret: The secret to be used when sending events to the business server’s callback endpoint. This is used to sign the request body when JWT authentication is enabled and it is the API key when API key authentication is enabled.auth: The authentication method to be used when sending events to the business server’s callback endpoint. The following are the supported authentication methods:JWT: The event service will send a JSON Web Token (JWT) in theAuthorizationheader of the request. The following are the supported configuration options:expiration_milliseconds: The expiration time of the JWT in milliseconds.http_header: The header in which the JWT will be sent.
API_KEY: The event service will send an API key in theAuthorizationheader of the request. The following are the supported configuration options:http_header: The header in which the API key will be sent.