Packages
stripity_stripe
1.2.0
3.3.2
3.3.1
3.2.0
3.1.1
3.1.0
3.0.0
2.17.3
2.17.2
2.17.1
2.17.0
2.16.0
2.15.1
2.15.0
2.14.1
2.14.0
2.13.0
2.12.1
2.12.0
2.11.0
2.10.0
2.9.0
2.8.0
2.7.2
2.7.1
2.7.0
2.6.0
2.5.0
2.4.0
2.3.0
2.2.3
2.2.2
2.2.1
2.2.0
2.1.0
2.0.1
2.0.0
2.0.0-alpha.11
2.0.0-alpha.10
2.0.0-alpha.9
2.0.0-alpha.8
2.0.0-alpha.7
2.0.0-alpha.6
2.0.0-alpha.5
2.0.0-alpha.4
2.0.0-alpha.3
2.0.0-alpha.2
2.0.0-alpha.1
1.6.2
1.6.1
1.6.0
1.4.0
1.3.0
1.2.0
1.1.0
0.5.0
0.4.0
0.3.0
0.2.0
A Stripe client for Elixir.
Current section
Files
Jump to
Current section
Files
lib/stripe/events.ex
defmodule Stripe.Events do
@moduledoc """
Main API for working with Events at Stripe. Through this API you can:
-list/search events (last 30 days guaranteed to be available)
-retrieve event from id
-count number of events stored currently on stripe
https://stripe.com/docs/api/curl#event_object
"""
@endpoint "events"
@doc """
Retrieves a given Event with the specified ID. Returns 404 if not found.
## Example
```
Stripe.Events.get "event_id"
```
"""
def get(id) do
get Stripe.config_or_env_key, id
end
@doc """
Retrieves a given Event with the specified ID using that key(account).
Returns 404 if not found.
## Example
```
{:ok, event} = Stripe.Events.get key, "event_id"
```
"""
def get(key,id) do
Stripe.make_request_with_key(:get, "#{@endpoint}/#{id}", key)
|> Stripe.Util.handle_stripe_full_response
end
@doc """
Count events.
## Example
```
{:ok, count} = Stripe.Events.count
```
"""
def count do
count Stripe.config_or_env_key
end
@doc """
Count events using given key.
## Example
```
{:ok, count} = Stripe.Events.count key
```
"""
def count(key) do
Stripe.Util.count "#{@endpoint}", key
end
@doc """
Returns a list of events
## Example
```
{:ok, events} = Stripe.Events.list "starting_after", limit // 10
```
"""
def list(starting_after, limit \\ 10) do
list Stripe.config_or_env_key, starting_after,limit
end
@doc """
Returns a list of events using given stripe key
## Example
```
{:ok, events} = Stripe.Events.list key, "starting_after", limit
```
"""
def list(key, starting_after, limit) do
Stripe.Util.list_raw( "#{@endpoint}", key, limit, starting_after)
end
end