Class: GpWebpay::Http::ValidateResult

Inherits:
Service
  • Object
show all
Defined in:
lib/gp_webpay/http/validate_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params, config) ⇒ ValidateResult

Returns a new instance of ValidateResult.



19
20
21
22
23
# File 'lib/gp_webpay/http/validate_result.rb', line 19

def initialize(params, config)
  super()
  @params = params
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



17
18
19
# File 'lib/gp_webpay/http/validate_result.rb', line 17

def config
  @config
end

#paramsObject (readonly)

Returns the value of attribute params.



17
18
19
# File 'lib/gp_webpay/http/validate_result.rb', line 17

def params
  @params
end

Instance Method Details

#callObject



25
26
27
28
29
30
31
# File 'lib/gp_webpay/http/validate_result.rb', line 25

def call
  params['DIGEST'] && params['DIGEST1'] && OpensslSecurity.validate_digests(
    config,
    params['DIGEST'] => digest_verification,
    params['DIGEST1'] => digest1_verification
  )
end