cover/Elixir.WalletIntegrations.Events.CallbackReceived.html

1 defmodule WalletIntegrations.Events.CallbackReceived do
2 @moduledoc "Emitted when an inbound provider callback is received and stored, before verification."
3 @behaviour WalletEvents.DomainEvent
4
5 @impl true
6 9 def event_name, do: "CallbackReceived.v1"
7 @impl true
8 9 def event_version, do: 1
9
10
:-(
def build(callback_id, opts \\ []) do
11 9 %{
12 event_id: WalletSharedKernel.Correlation.new_request_id(),
13 event_name: event_name(),
14 event_version: event_version(),
15 aggregate_id: callback_id,
16 correlation_id: Keyword.get(opts, :correlation_id, WalletSharedKernel.Correlation.new_correlation_id()),
17 occurred_at: DateTime.utc_now(),
18 payload: %{
19 callback_id: callback_id,
20 provider: Keyword.get(opts, :provider),
21 event_type: Keyword.get(opts, :event_type),
22 payload_hash: Keyword.get(opts, :payload_hash)
23 }
24 }
25 end
26 end
Line Hits Source