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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f854886a5db2a889088434912c1ee095998ec9cf1c6f1fab8a516e4d9de3fe2a
4
- data.tar.gz: 3cfe3db3c0746db88d5d3cf8a9f4b40e5fcecd5f1e204f74eaea7123aca1f6a6
3
+ metadata.gz: c80476ba099d00e9dfefb14d1b05d696a4b5cef3eb655e6f145c334e86fcf1ac
4
+ data.tar.gz: 4c1e6ae0d6cdfe4e1a013e2028b446912a636b295d949d499801e83ce4a640c8
5
5
  SHA512:
6
- metadata.gz: eed80e32167d30bad4ddcfd39483517ba61ec5c8644cd71e9bc0a2b6d9bc138b937c0699034b686358155145705dc0d2fd3f731d4ce5a23eb4e59d66c798be6d
7
- data.tar.gz: 48fa0d24f3b0e6f236c69eb809d71ec2b689c63eca38760484283459048bb6df5d5b0e7fc240306a204c41a68a3a60d21d064f1c86577f473f26fb61686b23f9
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.0'
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::Tenant)
42
- stripe.register(:charge_succeeded, Stripe::Processor::ChargeSucceeded::Landlord)
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", "tenant_payment_id").present?
61
+ payload.dig("metadata", "id").present?
62
62
  end
63
63
 
64
64
  def process!
65
- tenant_payment_id = payload.dig("metadata", "tenant_payment_id")
65
+ tenant_payment_id = payload.dig("metadata", "id")
66
66
  # Add your business logic here (e.g., update database records).
67
- puts "Processed tenant payment: #{tenant_payment_id}"
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.
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hooksmith
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
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.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-12 00:00:00.000000000 Z
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