Class: Stripe::EventService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/event_service.rb

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

#list(params = {}, opts = {}) ⇒ Object

List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header).



7
8
9
# File 'lib/stripe/services/event_service.rb', line 7

def list(params = {}, opts = {})
  request(method: :get, path: "/v1/events", params: params, opts: opts, base_address: :api)
end

#retrieve(id, params = {}, opts = {}) ⇒ Object

Retrieves the details of an event if it was created in the last 30 days. Supply the unique identifier of the event, which you might have received in a webhook.



12
13
14
15
16
17
18
19
20
# File 'lib/stripe/services/event_service.rb', line 12

def retrieve(id, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/events/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end