Class: PaypalAPI::WebhookVerifier Private
- Inherits:
-
Object
- Object
- PaypalAPI::WebhookVerifier
- Defined in:
- lib/paypal-api/webhook_verifier.rb,
lib/paypal-api/webhook_verifier/certs_cache.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Webhook Verifier
Defined Under Namespace
Classes: CertsCache, MissingHeader, NullCache
Instance Attribute Summary collapse
-
#client ⇒ Client
readonly
private
Current client.
Instance Method Summary collapse
-
#call(webhook_id:, headers:, raw_body:) ⇒ Boolean
private
Verifies Webhook.
-
#initialize(client) ⇒ WebhookVerifier
constructor
private
A new instance of WebhookVerifier.
Constructor Details
#initialize(client) ⇒ WebhookVerifier
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of WebhookVerifier.
18 19 20 |
# File 'lib/paypal-api/webhook_verifier.rb', line 18 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Client (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns current client.
16 17 18 |
# File 'lib/paypal-api/webhook_verifier.rb', line 16 def client @client end |
Instance Method Details
#call(webhook_id:, headers:, raw_body:) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Verifies Webhook.
It requires one-time request to download and cache certificate. If local verification returns false it tries to verify webhook online.
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/paypal-api/webhook_verifier.rb', line 32 def call(webhook_id:, headers:, raw_body:) args = { webhook_id: webhook_id, raw_body: raw_body, auth_algo: paypal_auth_algo(headers), transmission_sig: paypal_transmission_sig(headers), transmission_id: paypal_transmission_id(headers), transmission_time: paypal_transmission_time(headers), cert_url: paypal_cert_url(headers) } offline(**args) || online(**args) end |