Class: VisaAcceptanceMergedSpec::Account15

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/account15.rb

Overview

Account15 Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(suffix: SKIP, prefix: SKIP, check_number: SKIP, type: SKIP, name: SKIP, check_digit: SKIP, encoder_id: SKIP, additional_properties: nil) ⇒ Account15

Returns a new instance of Account15.



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/visa_acceptance_merged_spec/models/account15.rb', line 87

def initialize(suffix: SKIP, prefix: SKIP, check_number: SKIP, type: SKIP,
               name: SKIP, check_digit: SKIP, encoder_id: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @suffix = suffix unless suffix == SKIP
  @prefix = prefix unless prefix == SKIP
  @check_number = check_number unless check_number == SKIP
  @type = type unless type == SKIP
  @name = name unless name == SKIP
  @check_digit = check_digit unless check_digit == SKIP
  @encoder_id = encoder_id unless encoder_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#check_digitString

Code used to validate the customer’s account number. Required for some countries if you do not or are not allowed to provide the IBAN instead. You may use this field only when scoring a direct debit transaction.

Returns:

  • (String)


48
49
50
# File 'lib/visa_acceptance_merged_spec/models/account15.rb', line 48

def check_digit
  @check_digit
end

#check_numberString

Check number. Chase Paymentech Solutions - Optional. Visa Acceptance ACH Service - Not used. RBS WorldPay Atlanta - Optional on debits. Required on credits. TeleCheck - Strongly recommended on debit requests. Optional on credits.

Returns:

  • (String)


27
28
29
# File 'lib/visa_acceptance_merged_spec/models/account15.rb', line 27

def check_number
  @check_number
end

#encoder_idString

Identifier for the bank that provided the customer’s encoded account number. To obtain the bank identifier, contact your processor.

Returns:

  • (String)


54
55
56
# File 'lib/visa_acceptance_merged_spec/models/account15.rb', line 54

def encoder_id
  @encoder_id
end

#nameString

Name used on the bank account. You can use this field only when scoring a direct debit transaction

Returns:

  • (String)


41
42
43
# File 'lib/visa_acceptance_merged_spec/models/account15.rb', line 41

def name
  @name
end

#prefixString

Bank Identification Number (BIN). This is the initial four to six numbers on a credit card account number.

Returns:

  • (String)


19
20
21
# File 'lib/visa_acceptance_merged_spec/models/account15.rb', line 19

def prefix
  @prefix
end

#suffixString

Last four digits of the customer’s payment account number.

Returns:

  • (String)


14
15
16
# File 'lib/visa_acceptance_merged_spec/models/account15.rb', line 14

def suffix
  @suffix
end

#typeString

Account type. Possible values:

  • C: Checking.
  • G: General ledger. This value is supported only on Wells Fargo ACH.
  • S: Savings (U.S. dollars only).
  • X: Corporate checking (U.S. dollars only).

Returns:

  • (String)


36
37
38
# File 'lib/visa_acceptance_merged_spec/models/account15.rb', line 36

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/visa_acceptance_merged_spec/models/account15.rb', line 104

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  suffix = hash.key?('suffix') ? hash['suffix'] : SKIP
  prefix = hash.key?('prefix') ? hash['prefix'] : SKIP
  check_number = hash.key?('checkNumber') ? hash['checkNumber'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  check_digit = hash.key?('checkDigit') ? hash['checkDigit'] : SKIP
  encoder_id = hash.key?('encoderId') ? hash['encoderId'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  Account15.new(suffix: suffix,
                prefix: prefix,
                check_number: check_number,
                type: type,
                name: name,
                check_digit: check_digit,
                encoder_id: encoder_id,
                additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/visa_acceptance_merged_spec/models/account15.rb', line 57

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['suffix'] = 'suffix'
  @_hash['prefix'] = 'prefix'
  @_hash['check_number'] = 'checkNumber'
  @_hash['type'] = 'type'
  @_hash['name'] = 'name'
  @_hash['check_digit'] = 'checkDigit'
  @_hash['encoder_id'] = 'encoderId'
  @_hash
end

.nullablesObject

An array for nullable fields



83
84
85
# File 'lib/visa_acceptance_merged_spec/models/account15.rb', line 83

def self.nullables
  []
end

.optionalsObject

An array for optional fields



70
71
72
73
74
75
76
77
78
79
80
# File 'lib/visa_acceptance_merged_spec/models/account15.rb', line 70

def self.optionals
  %w[
    suffix
    prefix
    check_number
    type
    name
    check_digit
    encoder_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



143
144
145
146
147
148
149
# File 'lib/visa_acceptance_merged_spec/models/account15.rb', line 143

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} suffix: #{@suffix.inspect}, prefix: #{@prefix.inspect}, check_number:"\
  " #{@check_number.inspect}, type: #{@type.inspect}, name: #{@name.inspect}, check_digit:"\
  " #{@check_digit.inspect}, encoder_id: #{@encoder_id.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



135
136
137
138
139
140
# File 'lib/visa_acceptance_merged_spec/models/account15.rb', line 135

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} suffix: #{@suffix}, prefix: #{@prefix}, check_number: #{@check_number},"\
  " type: #{@type}, name: #{@name}, check_digit: #{@check_digit}, encoder_id: #{@encoder_id},"\
  " additional_properties: #{@additional_properties}>"
end