Class: Solidgate::Webhook
- Inherits:
-
Object
- Object
- Solidgate::Webhook
- Defined in:
- lib/solidgate/webhook.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Webhook resource for handling webhook-related operations.
Instance Method Summary collapse
-
#initialize(client = nil) ⇒ Webhook
constructor
A new instance of Webhook.
-
#validate_signature(payload, signature) ⇒ Boolean
Validate webhook signature.
Constructor Details
#initialize(client = nil) ⇒ Webhook
Returns a new instance of Webhook.
6 7 8 |
# File 'lib/solidgate/webhook.rb', line 6 def initialize(client = nil) @client = client || Solidgate.client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Webhook resource for handling webhook-related operations
4 5 6 |
# File 'lib/solidgate/webhook.rb', line 4 def client @client end |
Instance Method Details
#validate_signature(payload, signature) ⇒ Boolean
Validate webhook signature
14 15 16 17 18 |
# File 'lib/solidgate/webhook.rb', line 14 def validate_signature(payload, signature) client.generate_signature(payload, public_key: Solidgate.configuration.webhook_public_key, private_key: Solidgate.configuration.webhook_private_key) == signature end |