Class: WirecardCheckoutPage::ResponseChecksum

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/wirecard_checkout_page/response_checksum.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#stringify_keys

Constructor Details

#initialize(params) ⇒ ResponseChecksum

Returns a new instance of ResponseChecksum.


7
8
9
10
11
12
# File 'lib/wirecard_checkout_page/response_checksum.rb', line 7

def initialize(params)
  @params = stringify_keys(params)
  unless response_fingerprint_order_parts.include? 'secret'
    raise InvalidResponseFingerPrintOrder, 'Missing :secret as a part of the responseFingerprintOrder'
  end
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params


14
15
16
# File 'lib/wirecard_checkout_page/response_checksum.rb', line 14

def params
  @params
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)

16
17
18
# File 'lib/wirecard_checkout_page/response_checksum.rb', line 16

def valid?
  params['responseFingerprint'] == computed_fingerprint
end