gocardless v1.0.3 Gocardless.Behaviour.Event behaviour

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

Link to this section Summary

Callbacks

Gets an individual event by ID

Lists all events

Link to this section Callbacks

Link to this callback get_event(arg0)
get_event(String.t) :: tuple

Gets an individual event by ID

Examples

iex> Gocardless.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"}}}
Link to this callback list_events(map)
list_events(map) :: tuple

Lists all events

Examples

iex> Gocardless.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}}}