Class: Phaxio::Resources::Webhook

Inherits:
Object
  • Object
show all
Defined in:
lib/phaxio/resources/webhook.rb

Overview

Provides utilities for working with webhooks.

Class Method Summary collapse

Class Method Details

.valid_signature?(signature, url, params, files = []) ⇒ true, false

Determines whether or not the passed signature is valid for the given url, params, and files.

Parameters:

  • signature (String)

    The signature received from Phaxio.

  • url (String)

    The webhook URL used in this request.

  • params (Hash)

    The parameters received with the webhook, excluding files.

  • files (Array<File>) (defaults to: [])

    The files received with the webhook, if any.

Returns:

  • (true, false)

Raises:

See Also:



24
25
26
27
# File 'lib/phaxio/resources/webhook.rb', line 24

def valid_signature? signature, url, params, files = []
  check_signature = generate_check_signature url, params, files
  check_signature == signature
end