conekta_event 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd391e926e985f9c1fd8bfb919e3ddfd346d8b39
4
- data.tar.gz: 5836c0e3483d8591a296fdc6b7d81b04fd977a78
3
+ metadata.gz: 770fef37be44f47268e0b0f231166ae4f474d838
4
+ data.tar.gz: 6f33528ac0ee52786bfca0ccad0b181fb66d3911
5
5
  SHA512:
6
- metadata.gz: e87195423e6eedb7b7bf46665b2777e18baad163af2fbb3e27c389b9df19e7c9d53c86e8ded546de21d5101d4f12ca5b87d3ab65201f85a13e38ee9c7909f41f
7
- data.tar.gz: 2c29cf3bd3124c7f50c94839ee78cc0ace55be21c5f7fafa1ce7b0f072491ca15a56107433d9b4a6a20ffefe5872c4088285876c69fd1cfffdfc66c23ab90a69
6
+ metadata.gz: e254c380f98bc4927a12febcdfa687254d60f68bbfc51b07ce4aeb152824856c46d1cf5b0c1150ae5b1da4db53db5dda59f1dd41647b1657ca4f0228a300d1b1
7
+ data.tar.gz: ac842e935520f4e52e3d9429600c7d96689303217fa9bce0ba505a3b635247b63eb57a74c021ec085f0cc7cfd2c1bb42b993fbceeea34967726313a895cac277
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # ConektaEvent
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/conekta_event.svg)](https://badge.fury.io/rb/conekta_event)
4
+
2
5
  ConketaEvent is built on the [ActiveSupport::Notifications API](http://api.rubyonrails.org/classes/ActiveSupport/Notifications.html). Incoming webhook requests are authenticated by [retrieving the event object](https://developers.conekta.com/api#events) from Conketa. Define subscribers to handle specific event types. Subscribers can be a block or an object that responds to `#call`.
3
6
 
4
7
  This gem is based on [StripeEvent](https://github.com/integrallis/stripe_event) by [Ryan McGeary](https://github.com/rmm5t) , [Pete Keen](https://github.com/peterkeen) and [Danny Whalen](https://github.com/invisiblefunnel) . ConektaEvent improves on the gem, updating for Rails 4, using [Conekta](https://www.conekta.com/en) as Payment Gateway.
@@ -84,7 +87,7 @@ To prevent this, ConektEvent supports verification by signature on your webhook
84
87
  ```ruby
85
88
  # CONEKTA_PRIVATE_SIGNATURE environment variable
86
89
  ConektaEvent.private_signature = ENV['CONEKTA_PRIVATE_SIGNATURE']
87
- # stripe_webhook_secret key in secrets.yml file
90
+ # conekta_private_signature key in secrets.yml file
88
91
  ConektaEvent.private_signature = Rails.application.secrets.conekta_private_signature
89
92
  ```
90
93
 
@@ -113,7 +116,7 @@ end
113
116
 
114
117
  ## Testing
115
118
 
116
- Handling webhooks is a critical piece of modern billing systems. Verifying the behavior of ConektaEvent subscribers can be done fairly easily by stubbing out the HTTP request used to authenticate the webhook request. Tools like [Webmock](https://github.com/bblimke/webmock) and [VCR](https://github.com/vcr/vcr) work well. [RequestBin](http://requestb.in/) is great for collecting the payloads. For exploratory phases of development, [UltraHook](http://www.ultrahook.com/) and other tools can forward webhook requests directly to localhost. You can check out [test-hooks](https://github.com/invisiblefunnel/test-hooks), an example Rails application to see how to test ConektaEvent subscribers with RSpec request specs and Webmock. A quick look:
119
+ Handling webhooks is a critical piece of modern billing systems. Verifying the behavior of ConektaEvent subscribers can be done fairly easily by stubbing out the HTTP request used to authenticate the webhook request. Tools like [Webmock](https://github.com/bblimke/webmock) and [VCR](https://github.com/vcr/vcr) work well. [RequestBin](http://requestb.in/) is great for collecting the payloads. For exploratory phases of development, [UltraHook](http://www.ultrahook.com/) and other tools can forward webhook requests directly to localhost. An example:
117
120
 
118
121
  ```ruby
119
122
  # spec/requests/billing_events_spec.rb
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.license = "MIT"
16
16
 
17
17
  s.files = `git ls-files`.split("\n")
18
- s.test_files = `git ls-files -- test/*`.split("\n")
18
+ s.test_files = `git ls-files -- test/*`.split("\n")
19
19
 
20
20
  s.add_dependency "activesupport", ">= 4.2.5"
21
21
  s.add_dependency "conekta", ">= 2.0.0"
@@ -1,3 +1,3 @@
1
1
  module ConektaEvent
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
data/lib/conekta_event.rb CHANGED
@@ -27,8 +27,8 @@ module ConektaEvent
27
27
  rescue Conekta::Error => e
28
28
  raise UnauthorizedError.new(e)
29
29
  end
30
-
31
- backend.instrument namespace.call(event[:type]), event if event
30
+
31
+ backend.instrument namespace.call(event.type), event if event
32
32
  end
33
33
 
34
34
  def subscribe(name, callable = Proc.new)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conekta_event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jorge Najera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-02 00:00:00.000000000 Z
11
+ date: 2017-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport