README.md in stripe_event-0.3.0 vs README.md in stripe_event-0.3.1
- old
+ new
@@ -1,32 +1,30 @@
## stripe_event
[![Build Status](https://secure.travis-ci.org/integrallis/stripe_event.png?branch=master)](http://travis-ci.org/integrallis/stripe_event)
-stripe_event is built on the ActiveSupport::Notifications API. Incoming webhook requests are authenticated by retrieving the event from Stripe. Authenticated events are published to subscribers.
+stripe_event is built on the ActiveSupport::Notifications API. Incoming webhook requests are authenticated by retrieving the [event object](https://stripe.com/docs/api?lang=ruby#event_object) from Stripe. Define subscriber blocks to handle one, many, or all event types.
## Install
-
```ruby
# Gemfile
gem 'stripe_event'
```
```ruby
# config/routes.rb
-mount StripeEvent::Engine => "/stripe_event" # or provide a custom path
+mount StripeEvent::Engine => "/my-chosen-path" # provide a custom path
```
## Usage
```ruby
# config/initializers/stripe.rb
Stripe.api_key = ENV['STRIPE_API_KEY'] # Set your api key
-StripeEvent.registration do
-
+StripeEvent.setup do
subscribe 'charge.failed' do |event|
MyClass.handle_failed_charge(event) # Define subscriber behavior
end
subscribe 'customer.created', 'customer.updated' do |event|
@@ -34,10 +32,9 @@
end
subscribe do |event|
# Handle all event types - logging, etc.
end
-
end
```
## Register webhook url with Stripe