Class: Vnpay::Verify

Inherits:
Object
  • Object
show all
Defined in:
lib/vnpay/verify.rb

Constant Summary collapse

REJECTED_PARAMS =
%w[vnp_SecureHashType vnp_SecureHash controller action].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Verify

Returns a new instance of Verify.



8
9
10
# File 'lib/vnpay/verify.rb', line 8

def initialize(params)
  @params = params.permit!.to_h
end

Instance Attribute Details

#normalized_paramsObject (readonly)

Returns the value of attribute normalized_params.



6
7
8
# File 'lib/vnpay/verify.rb', line 6

def normalized_params
  @normalized_params
end

#paramsObject (readonly)

Returns the value of attribute params.



6
7
8
# File 'lib/vnpay/verify.rb', line 6

def params
  @params
end

Instance Method Details

#verifyObject



12
13
14
15
16
17
18
19
# File 'lib/vnpay/verify.rb', line 12

def verify
  normalize_params

  return false unless success_code?
  return false unless valid_hash?

  true
end