Event Processor Integration
In this section, we will discuss the Event Processor integration component that is required in order to enable the ability to make contributions to jackpots.
In general, this integration component needs to be able to receive the events that will drive jackpot contributions on behalf of users/players.
In a standard ThrillPots-powered system, it is usually gameplay that causes jackpot contributions to be made on behalf of players, but you are not limited to just this single use case.
From a simplistic perspective, the general logic should look something like this:
Authenticate your integration service with ThrillPots Gateway
Subscribe to gameplay/bet events from your event stream
When an event is received from your event stream:
- Read the properties of the event for game code, player ID and bet amount
- Make a contribution call to ThrillPots using these (and other values)
From here, it is relatively easy to see how you could expand the use case to create a Deposit jackpot. Lets imagine that the deposit flow was identified by source
DEPOSIT. Lets also assume that when a successful deposit has been made by a player, that an event is published by the operator's platform. For argument's sake, lets call this event DEPOSIT_SUCCESS
.
If we wanted to create a deposit jackpot, the logic could look as follows:
Subscribe to DEPOSIT_SUCCESS event
When an event is received:
- Read the properties of the event for the player ID and deposit amount
- Make a contribution call to ThrillPots using the DEPOSIT source_id and other properties
Sequence Diagram for the Event Processor integration
Authenticating via ThrillPots Gateway
The ThrillPots Gateway service exposes a REST endpoint which your event stream process can authenticate itself with Thrill-ID.
The endpoint is POST /authenticate/service
and accepts a payload which contains the connecting service's username
and password
.
If authentication is successful, you will receive a response which contains token
which must be used as a Bearer
token in subsequent API requests to the ThrillPots Gateway service. Service
tokens do not expire and therefore you do not need to be concerned with refreshing your token once it has been received.
NOTE: As part of your SaaS integration info pack, you will have received the details of the
Service
account that you must use for your Event Processor authentication.
Additional Information
If your event processor service is processing gameplay bet events, you should remember to filter out any and all events related to Jackpot Contributions as this could create loop of contributions on behalf of players