Class: GpWebpay::Ws::ValidateResult

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

Constant Summary collapse

DIGEST_ALLOWED_ATTRIBUTES =
%i[
  primary_return_code
  secondary_return_code
  message_id
  state
  status
  sub_status
  auth_code
  token_data
  authentication_link
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params, config) ⇒ ValidateResult

Returns a new instance of ValidateResult.



29
30
31
32
33
# File 'lib/gp_webpay/ws/validate_result.rb', line 29

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

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



15
16
17
# File 'lib/gp_webpay/ws/validate_result.rb', line 15

def config
  @config
end

#paramsObject (readonly)

Returns the value of attribute params.



15
16
17
# File 'lib/gp_webpay/ws/validate_result.rb', line 15

def params
  @params
end

Instance Method Details

#callObject



35
36
37
38
39
# File 'lib/gp_webpay/ws/validate_result.rb', line 35

def call
  params.present? &&
    params[:signature].present? &&
    OpensslSecurity.validate_digests(config, params[:signature] => digest_verification)
end