conekta_event 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/conekta_event.gemspec +1 -1
- data/lib/conekta_event/version.rb +1 -1
- data/lib/conekta_event.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 770fef37be44f47268e0b0f231166ae4f474d838
|
4
|
+
data.tar.gz: 6f33528ac0ee52786bfca0ccad0b181fb66d3911
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e254c380f98bc4927a12febcdfa687254d60f68bbfc51b07ce4aeb152824856c46d1cf5b0c1150ae5b1da4db53db5dda59f1dd41647b1657ca4f0228a300d1b1
|
7
|
+
data.tar.gz: ac842e935520f4e52e3d9429600c7d96689303217fa9bce0ba505a3b635247b63eb57a74c021ec085f0cc7cfd2c1bb42b993fbceeea34967726313a895cac277
|
data/README.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
# ConektaEvent
|
2
|
+
|
3
|
+
[](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
|
-
#
|
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.
|
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
|
data/conekta_event.gemspec
CHANGED
@@ -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
|
-
|
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"
|
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
|
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.
|
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-
|
11
|
+
date: 2017-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|