stripe_event 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
- stripe_event
2
- ============
1
+ ## stripe_event
2
+
3
+ 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.
4
+
5
+ ## Install
3
6
 
4
- stripe_event is built on the ActiveSupport::Notifications API. Incoming webhook requests are authenticated by retrieving the event from Stripe. The retrieved event is yielded to subscribers when published.
5
7
 
6
8
  ```ruby
7
9
  # Gemfile
@@ -10,17 +12,21 @@ gem 'stripe_event'
10
12
 
11
13
  ```ruby
12
14
  # config/routes.rb
13
- mount StripeEvent::Engine => "/stripe_event"
15
+ mount StripeEvent::Engine => "/stripe_event" # or provide a custom path
14
16
  ```
15
17
 
18
+ ## Usage
19
+
16
20
  ```ruby
17
21
  # config/initializers/stripe.rb
18
22
  Stripe.api_key = ENV['STRIPE_API_KEY'] # Set your api key
19
23
 
20
- StripeEvent.configure do |config|
21
- # Define subscriber behavior
22
- config.subscribe 'charge.failed' do |event|
23
- MyClass.handle_failed_charge(event)
24
- end
24
+ # Define subscriber behavior
25
+ StripeEvent.subscribe 'charge.failed' do |event|
26
+ MyClass.handle_failed_charge(event)
25
27
  end
26
28
  ```
29
+
30
+ ## Register webhook url with Stripe
31
+
32
+ ![Setup webhook url](https://raw.github.com/integrallis/stripe_event/master/screenshots/dashboard-webhook.png "webhook setup")
data/lib/stripe_event.rb CHANGED
@@ -3,7 +3,6 @@ require "stripe_event/engine"
3
3
  require "stripe_event/types"
4
4
 
5
5
  module StripeEvent
6
- InvalidEventType = Class.new(StandardError)
7
6
 
8
7
  def self.configure
9
8
  yield self
@@ -1,4 +1,6 @@
1
1
  module StripeEvent
2
+ InvalidEventType = Class.new(StandardError)
3
+
2
4
  TYPES = [
3
5
  'charge.succeeded',
4
6
  'charge.failed',
@@ -1,3 +1,3 @@
1
1
  module StripeEvent
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe_event
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-24 00:00:00.000000000 Z
12
+ date: 2012-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70267703430460 !ruby/object:Gem::Requirement
16
+ requirement: &70194009727360 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70267703430460
24
+ version_requirements: *70194009727360
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: stripe
27
- requirement: &70267703429960 !ruby/object:Gem::Requirement
27
+ requirement: &70194009726780 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,21 +32,21 @@ dependencies:
32
32
  version: '1.6'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70267703429960
35
+ version_requirements: *70194009726780
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sqlite3
38
- requirement: &70267703429580 !ruby/object:Gem::Requirement
38
+ requirement: &70194009726080 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
- - - ! '>='
41
+ - - ~>
42
42
  - !ruby/object:Gem::Version
43
- version: '0'
43
+ version: '1.3'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70267703429580
46
+ version_requirements: *70194009726080
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec-rails
49
- requirement: &70267703428980 !ruby/object:Gem::Requirement
49
+ requirement: &70194009725500 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,19 +54,19 @@ dependencies:
54
54
  version: '2.10'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70267703428980
57
+ version_requirements: *70194009725500
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: webmock
60
- requirement: &70267703428540 !ruby/object:Gem::Requirement
60
+ requirement: &70194009725000 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
- - - ! '>='
63
+ - - ~>
64
64
  - !ruby/object:Gem::Version
65
- version: '0'
65
+ version: '1.8'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70267703428540
69
- description: Easily handle webhook events from Stripe.
68
+ version_requirements: *70194009725000
69
+ description: Stripe webhook integration for Rails applications.
70
70
  email:
71
71
  - dwhalen@integrallis.com
72
72
  executables: []
@@ -106,6 +106,6 @@ rubyforge_project:
106
106
  rubygems_version: 1.8.15
107
107
  signing_key:
108
108
  specification_version: 3
109
- summary: Stripe webhook integration for Rails applications
109
+ summary: Stripe webhook integration for Rails applications.
110
110
  test_files: []
111
111
  has_rdoc: