hooksmith 0.1.1 → 0.1.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 +8 -8
- data/lib/hooksmith/railtie.rb +0 -2
- data/lib/hooksmith/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c80476ba099d00e9dfefb14d1b05d696a4b5cef3eb655e6f145c334e86fcf1ac
|
4
|
+
data.tar.gz: 4c1e6ae0d6cdfe4e1a013e2028b446912a636b295d949d499801e83ce4a640c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c004376be79241af2a779aa9eeafe4bd4075d09ab45da029d8c9d88ed6faa2d1248652b160ac0761a107c7e0ddddec81a41cec8ed1f5e147f1e6f43d8dd9ca0
|
7
|
+
data.tar.gz: c555b8226888a88774fb0fd97bd3b57a1741a35bdd615d462bbd479786ab6a1aede0875a070cb9fcbc0d76f4b3ad6ac85256ff023dd2d9e9ccd552fcd8d928fe
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
Add this line to your application's Gemfile:
|
16
16
|
|
17
17
|
```ruby
|
18
|
-
gem 'hooksmith', '~> 0.1.
|
18
|
+
gem 'hooksmith', '~> 0.1.1'
|
19
19
|
```
|
20
20
|
|
21
21
|
Then execute:
|
@@ -38,12 +38,12 @@ Configure your webhook processors in an initializer (e.g., `config/initializers/
|
|
38
38
|
```ruby
|
39
39
|
Hooksmith.configure do |config|
|
40
40
|
config.provider(:stripe) do |stripe|
|
41
|
-
stripe.register(:charge_succeeded, Stripe::Processor::ChargeSucceeded::
|
42
|
-
stripe.register(:charge_succeeded, Stripe::Processor::ChargeSucceeded::
|
41
|
+
stripe.register(:charge_succeeded, 'Stripe::Processor::ChargeSucceeded::First')
|
42
|
+
stripe.register(:charge_succeeded, 'Stripe::Processor::ChargeSucceeded::Second')
|
43
43
|
end
|
44
44
|
|
45
45
|
config.provider(:paypal) do |paypal|
|
46
|
-
paypal.register(:payment_received, Paypal::Processor::PaymentReceived)
|
46
|
+
paypal.register(:payment_received, 'Paypal::Processor::PaymentReceived')
|
47
47
|
end
|
48
48
|
end
|
49
49
|
```
|
@@ -58,13 +58,13 @@ module Stripe
|
|
58
58
|
class Tenant < Hooksmith::Processor::Base
|
59
59
|
# Only handle events with a tenant_payment_id.
|
60
60
|
def can_handle?(payload)
|
61
|
-
payload.dig("metadata", "
|
61
|
+
payload.dig("metadata", "id").present?
|
62
62
|
end
|
63
63
|
|
64
64
|
def process!
|
65
|
-
tenant_payment_id = payload.dig("metadata", "
|
65
|
+
tenant_payment_id = payload.dig("metadata", "id")
|
66
66
|
# Add your business logic here (e.g., update database records).
|
67
|
-
puts "Processed
|
67
|
+
puts "Processed id : #{id}"
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
@@ -116,4 +116,4 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/gregor
|
|
116
116
|
|
117
117
|
|
118
118
|
## License
|
119
|
-
The gem is available as open source under the terms of the MIT License.
|
119
|
+
The gem is available as open source under the terms of the MIT License.
|
data/lib/hooksmith/railtie.rb
CHANGED
@@ -7,8 +7,6 @@ if defined?(Rails)
|
|
7
7
|
# This file allows Hooksmith to integrate seamlessly with a Rails application.
|
8
8
|
class Railtie < Rails::Railtie
|
9
9
|
initializer 'hooksmith.configure_rails_initialization' do |_|
|
10
|
-
Hooksmith.logger.info('Hooksmith initialized in Rails')
|
11
|
-
# Optionally set the gem logger to use Rails.logger if available.
|
12
10
|
if defined?(Rails.logger) && Rails.logger
|
13
11
|
Hooksmith::Logger.instance.instance_variable_set(:@logger, Rails.logger)
|
14
12
|
end
|
data/lib/hooksmith/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hooksmith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gregoryrivage
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-03-
|
10
|
+
date: 2025-03-13 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: Hooksmith is a gem that allows you to handle webhooks in your Rails application.
|
13
13
|
It provides a simple and flexible way to receive, validate, and process webhooks
|