Class: Phaxio::Resources::Callback

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

Overview

Provides utilities for working with callbacks.

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 callback URL used in this request.

  • params (Hash)

    The parameters received with the callback, excluding files.

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

    The files received with the callback, if any.

Returns:

  • (true, false)

Raises:

See Also:


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

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