Class: BankAudi::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Response

Returns a new instance of Response.



76
77
78
# File 'lib/bank_audi.rb', line 76

def initialize(options = {})
  @secret_code, @attributes = OPTIONS['secret_code'], HashWithIndifferentAccess.new(options)
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



74
75
76
# File 'lib/bank_audi.rb', line 74

def attributes
  @attributes
end

#errorsObject (readonly)

Returns the value of attribute errors.



73
74
75
# File 'lib/bank_audi.rb', line 73

def errors
  @errors
end

#secret_codeObject (readonly)

Returns the value of attribute secret_code.



73
74
75
# File 'lib/bank_audi.rb', line 73

def secret_code
  @secret_code
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


84
85
86
87
# File 'lib/bank_audi.rb', line 84

def valid?
  @errors = {}
  valid_vpc_txn_response_code? && valid_vpc_secure_hash?
end

#vpc_secure_hashObject



89
90
91
# File 'lib/bank_audi.rb', line 89

def vpc_secure_hash
  (@attributes[:vpc_secure_hash] || @attributes[:vpc_SecureHash]).upcase
end

#vpc_txn_response_codeObject



93
94
95
# File 'lib/bank_audi.rb', line 93

def vpc_txn_response_code
  @attributes[:vpc_txn_response_code] || @attributes[:vpc_TxnResponseCode]
end