Gocardlex.Behaviour.Event behaviour (gocardlex v1.0.4)

Defines the behaviour for Events, you cannot create or edit Events, only view them.

Summary

Callbacks

Gets an individual event by ID

Lists all events

Callbacks

get_event(t)

@callback get_event(String.t()) :: tuple()

Gets an individual event by ID

Examples

iex> Gocardlex.Client.get_event("EV000099999999")
{:ok,
 %{"events" => %{"action" => "created",
     "created_at" => "2017-06-27T10:00:26.278Z",
     "details" => %{"cause" => "payment_refunded",
       "description" => "The refund has been created, and will be submitted in the next batch.",
       "origin" => "api"}, "id" => "EV000099999999",
     "links" => %{"refund" => "RF000099999999"}, "metadata" => %{},
     "resource_type" => "refunds"}}}

list_events(map)

@callback list_events(map()) :: tuple()

Lists all events

Examples

iex> Gocardlex.Client.list_events
{:ok,
 %{"events" => [%{"action" => "created",
      "created_at" => "2017-06-27T14:14:43.390Z",
      "details" => %{"cause" => "mandate_created",
        "description" => "Mandate created via the API.", "origin" => "api"},
      "id" => "EV000QBP163MV1", "links" => %{"mandate" => "MD000099999999"},
      "metadata" => %{}, "resource_type" => "mandates"}],
   "meta" => %{"cursors" => %{"after" => "EV000099999999", "before" => nil},
     "limit" => 50}}}