class OpenapiClient::TeleCheckAchPaymentMethod

ACH means automated clearing house. Contains properties common across TeleCheck message types. Abstract class, do not use this class directly, use one of its children.

Attributes

account_number[RW]

Bank account number.

account_type[RW]

Identifies if the account type is checking or savings.

ach_bill_to[RW]
ach_type[RW]

ACH application type values will be one of either TeleCheckICAPaymentMethod or TeleCheckCBPPaymentMethod.

agent_id[RW]

Used to track the agent transaction activity.

check_number[RW]

Check number.

check_type[RW]

Identifies if the check type is personal or company.

manual_id_info[RW]
product_code[RW]

Identifies the product code in the transaction.

registration_date[RW]

Date the consumer originally registered in format MMDDYYYY.

registration_id[RW]

Unique ID assigned by the merchant for the consumer (never recycled). It is an additional level of authentication. To use this feature, the merchant must work with TeleCheck Risk to discuss. Registration IDs must not be generated for an existing or returning consumer returns. The single registration ID must be unique per consumer.

release_type[RW]

Release type is used as a risk variable to gauge risk level when the merchant is releasing the purchased merchandise.

routing_number[RW]

Bank routing number.

session_id[RW]

Session identifier.

supplement_id_info[RW]
terminal_city[RW]

Identifies the city where the original sale transaction occurred.

terminal_id[RW]

Identifies the register or lane number where the original sale transaction occurred.

terminal_state[RW]

Identifies the US state or territory where the original sale transaction occurred.

vip_customer[RW]

Flags a transaction as a VIP order (based on merchant criteria). This field should not be sent for non-VIP orders.

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 95
def self.attribute_map
  {
    :'ach_type' => :'achType',
    :'routing_number' => :'routingNumber',
    :'account_number' => :'accountNumber',
    :'account_type' => :'accountType',
    :'check_number' => :'checkNumber',
    :'check_type' => :'checkType',
    :'product_code' => :'productCode',
    :'manual_id_info' => :'manualIdInfo',
    :'supplement_id_info' => :'supplementIdInfo',
    :'agent_id' => :'agentId',
    :'terminal_id' => :'terminalId',
    :'registration_id' => :'registrationId',
    :'registration_date' => :'registrationDate',
    :'release_type' => :'releaseType',
    :'vip_customer' => :'vipCustomer',
    :'session_id' => :'sessionId',
    :'terminal_state' => :'terminalState',
    :'terminal_city' => :'terminalCity',
    :'ach_bill_to' => :'achBillTo'
  }
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 668
def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 151
def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::TeleCheckAchPaymentMethod` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TeleCheckAchPaymentMethod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'ach_type')
    self.ach_type = attributes[:'ach_type']
  end

  if attributes.key?(:'routing_number')
    self.routing_number = attributes[:'routing_number']
  end

  if attributes.key?(:'account_number')
    self.account_number = attributes[:'account_number']
  end

  if attributes.key?(:'account_type')
    self.account_type = attributes[:'account_type']
  end

  if attributes.key?(:'check_number')
    self.check_number = attributes[:'check_number']
  end

  if attributes.key?(:'check_type')
    self.check_type = attributes[:'check_type']
  end

  if attributes.key?(:'product_code')
    self.product_code = attributes[:'product_code']
  end

  if attributes.key?(:'manual_id_info')
    self.manual_id_info = attributes[:'manual_id_info']
  end

  if attributes.key?(:'supplement_id_info')
    self.supplement_id_info = attributes[:'supplement_id_info']
  end

  if attributes.key?(:'agent_id')
    self.agent_id = attributes[:'agent_id']
  end

  if attributes.key?(:'terminal_id')
    self.terminal_id = attributes[:'terminal_id']
  end

  if attributes.key?(:'registration_id')
    self.registration_id = attributes[:'registration_id']
  end

  if attributes.key?(:'registration_date')
    self.registration_date = attributes[:'registration_date']
  end

  if attributes.key?(:'release_type')
    self.release_type = attributes[:'release_type']
  end

  if attributes.key?(:'vip_customer')
    self.vip_customer = attributes[:'vip_customer']
  end

  if attributes.key?(:'session_id')
    self.session_id = attributes[:'session_id']
  end

  if attributes.key?(:'terminal_state')
    self.terminal_state = attributes[:'terminal_state']
  end

  if attributes.key?(:'terminal_city')
    self.terminal_city = attributes[:'terminal_city']
  end

  if attributes.key?(:'ach_bill_to')
    self.ach_bill_to = attributes[:'ach_bill_to']
  end
end
openapi_discriminator_name() click to toggle source

discriminator's property name in OpenAPI v3

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 145
def self.openapi_discriminator_name
  :'ach_type'
end
openapi_types() click to toggle source

Attribute type mapping.

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 120
def self.openapi_types
  {
    :'ach_type' => :'String',
    :'routing_number' => :'String',
    :'account_number' => :'String',
    :'account_type' => :'String',
    :'check_number' => :'String',
    :'check_type' => :'String',
    :'product_code' => :'String',
    :'manual_id_info' => :'IdInfo',
    :'supplement_id_info' => :'IdInfo',
    :'agent_id' => :'String',
    :'terminal_id' => :'String',
    :'registration_id' => :'String',
    :'registration_date' => :'Date',
    :'release_type' => :'String',
    :'vip_customer' => :'String',
    :'session_id' => :'String',
    :'terminal_state' => :'String',
    :'terminal_city' => :'String',
    :'ach_bill_to' => :'TeleCheckAchPaymentMethodAchBillTo'
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 629
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      ach_type == o.ach_type &&
      routing_number == o.routing_number &&
      account_number == o.account_number &&
      account_type == o.account_type &&
      check_number == o.check_number &&
      check_type == o.check_type &&
      product_code == o.product_code &&
      manual_id_info == o.manual_id_info &&
      supplement_id_info == o.supplement_id_info &&
      agent_id == o.agent_id &&
      terminal_id == o.terminal_id &&
      registration_id == o.registration_id &&
      registration_date == o.registration_date &&
      release_type == o.release_type &&
      vip_customer == o.vip_customer &&
      session_id == o.session_id &&
      terminal_state == o.terminal_state &&
      terminal_city == o.terminal_city &&
      ach_bill_to == o.ach_bill_to
end
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 696
def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    klass = OpenapiClient.const_get(type)
    if klass.respond_to?(:openapi_discriminator_name)
      klass = OpenapiClient.const_get(value[klass.attribute_map[klass.openapi_discriminator_name]])
    end
 
    klass.build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 770
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end
account_number=(account_number) click to toggle source

Custom attribute writer method with validation @param [Object] account_number Value to be assigned

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 442
def account_number=(account_number)
  if account_number.nil?
    fail ArgumentError, 'account_number cannot be nil'
  end

  if account_number.to_s.length > 56
    fail ArgumentError, 'invalid value for "account_number", the character length must be smaller than or equal to 56.'
  end

  if account_number.to_s.length < 1
    fail ArgumentError, 'invalid value for "account_number", the character length must be great than or equal to 1.'
  end

  pattern = Regexp.new(/^[0-9]+$/)
  if account_number !~ pattern
    fail ArgumentError, "invalid value for \"account_number\", must conform to the pattern #{pattern}."
  end

  @account_number = account_number
end
account_type=(account_type) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] account_type Object to be assigned

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 465
def account_type=(account_type)
  validator = EnumAttributeValidator.new('String', ["C", "S"])
  unless validator.valid?(account_type)
    fail ArgumentError, "invalid value for \"account_type\", must be one of #{validator.allowable_values}."
  end
  @account_type = account_type
end
agent_id=(agent_id) click to toggle source

Custom attribute writer method with validation @param [Object] agent_id Value to be assigned

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 515
def agent_id=(agent_id)
  if !agent_id.nil? && agent_id.to_s.length > 6
    fail ArgumentError, 'invalid value for "agent_id", the character length must be smaller than or equal to 6.'
  end

  pattern = Regexp.new(/(?=.*[^\s])^[^|]+$/)
  if !agent_id.nil? && agent_id !~ pattern
    fail ArgumentError, "invalid value for \"agent_id\", must conform to the pattern #{pattern}."
  end

  @agent_id = agent_id
end
build_from_hash(attributes, attribute_map = self.class.attribute_map, openapi_types = self.class.openapi_types) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 675
def build_from_hash(attributes, attribute_map = self.class.attribute_map, openapi_types = self.class.openapi_types)
  return nil unless attributes.is_a?(Hash)
  openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end
check_number=(check_number) click to toggle source

Custom attribute writer method with validation @param [Object] check_number Value to be assigned

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 475
def check_number=(check_number)
  if !check_number.nil? && check_number.to_s.length > 10
    fail ArgumentError, 'invalid value for "check_number", the character length must be smaller than or equal to 10.'
  end

  pattern = Regexp.new(/^[0-9]+$/)
  if !check_number.nil? && check_number !~ pattern
    fail ArgumentError, "invalid value for \"check_number\", must conform to the pattern #{pattern}."
  end

  @check_number = check_number
end
check_type=(check_type) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] check_type Object to be assigned

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 490
def check_type=(check_type)
  validator = EnumAttributeValidator.new('String', ["P", "C"])
  unless validator.valid?(check_type)
    fail ArgumentError, "invalid value for \"check_type\", must be one of #{validator.allowable_values}."
  end
  @check_type = check_type
end
eql?(o) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 655
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Integer] Hash code

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 661
def hash
  [ach_type, routing_number, account_number, account_type, check_number, check_type, product_code, manual_id_info, supplement_id_info, agent_id, terminal_id, registration_id, registration_date, release_type, vip_customer, session_id, terminal_state, terminal_city, ach_bill_to].hash
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 243
def list_invalid_properties
  invalid_properties = Array.new
  if @ach_type.nil?
    invalid_properties.push('invalid value for "ach_type", ach_type cannot be nil.')
  end

  if @routing_number.nil?
    invalid_properties.push('invalid value for "routing_number", routing_number cannot be nil.')
  end

  if @routing_number.to_s.length > 9
    invalid_properties.push('invalid value for "routing_number", the character length must be smaller than or equal to 9.')
  end

  if @routing_number.to_s.length < 9
    invalid_properties.push('invalid value for "routing_number", the character length must be great than or equal to 9.')
  end

  pattern = Regexp.new(/^[0-9]+$/)
  if @routing_number !~ pattern
    invalid_properties.push("invalid value for \"routing_number\", must conform to the pattern #{pattern}.")
  end

  if @account_number.nil?
    invalid_properties.push('invalid value for "account_number", account_number cannot be nil.')
  end

  if @account_number.to_s.length > 56
    invalid_properties.push('invalid value for "account_number", the character length must be smaller than or equal to 56.')
  end

  if @account_number.to_s.length < 1
    invalid_properties.push('invalid value for "account_number", the character length must be great than or equal to 1.')
  end

  pattern = Regexp.new(/^[0-9]+$/)
  if @account_number !~ pattern
    invalid_properties.push("invalid value for \"account_number\", must conform to the pattern #{pattern}.")
  end

  if @account_type.nil?
    invalid_properties.push('invalid value for "account_type", account_type cannot be nil.')
  end

  if !@check_number.nil? && @check_number.to_s.length > 10
    invalid_properties.push('invalid value for "check_number", the character length must be smaller than or equal to 10.')
  end

  pattern = Regexp.new(/^[0-9]+$/)
  if !@check_number.nil? && @check_number !~ pattern
    invalid_properties.push("invalid value for \"check_number\", must conform to the pattern #{pattern}.")
  end

  if @check_type.nil?
    invalid_properties.push('invalid value for "check_type", check_type cannot be nil.')
  end

  if !@product_code.nil? && @product_code.to_s.length > 6
    invalid_properties.push('invalid value for "product_code", the character length must be smaller than or equal to 6.')
  end

  pattern = Regexp.new(/^[0-9]+$/)
  if !@product_code.nil? && @product_code !~ pattern
    invalid_properties.push("invalid value for \"product_code\", must conform to the pattern #{pattern}.")
  end

  if !@agent_id.nil? && @agent_id.to_s.length > 6
    invalid_properties.push('invalid value for "agent_id", the character length must be smaller than or equal to 6.')
  end

  pattern = Regexp.new(/(?=.*[^\s])^[^|]+$/)
  if !@agent_id.nil? && @agent_id !~ pattern
    invalid_properties.push("invalid value for \"agent_id\", must conform to the pattern #{pattern}.")
  end

  if !@terminal_id.nil? && @terminal_id.to_s.length > 10
    invalid_properties.push('invalid value for "terminal_id", the character length must be smaller than or equal to 10.')
  end

  pattern = Regexp.new(/^[0-9]+$/)
  if !@terminal_id.nil? && @terminal_id !~ pattern
    invalid_properties.push("invalid value for \"terminal_id\", must conform to the pattern #{pattern}.")
  end

  if !@registration_id.nil? && @registration_id.to_s.length > 50
    invalid_properties.push('invalid value for "registration_id", the character length must be smaller than or equal to 50.')
  end

  pattern = Regexp.new(/(?=.*[^\s])^[^|]+$/)
  if !@registration_id.nil? && @registration_id !~ pattern
    invalid_properties.push("invalid value for \"registration_id\", must conform to the pattern #{pattern}.")
  end

  if @session_id.nil?
    invalid_properties.push('invalid value for "session_id", session_id cannot be nil.')
  end

  if @session_id.to_s.length > 128
    invalid_properties.push('invalid value for "session_id", the character length must be smaller than or equal to 128.')
  end

  pattern = Regexp.new(/(?=.*[^\s])^[^|]+$/)
  if @session_id !~ pattern
    invalid_properties.push("invalid value for \"session_id\", must conform to the pattern #{pattern}.")
  end

  if !@terminal_state.nil? && @terminal_state.to_s.length > 2
    invalid_properties.push('invalid value for "terminal_state", the character length must be smaller than or equal to 2.')
  end

  pattern = Regexp.new(/^[A-Z]{2}$/)
  if !@terminal_state.nil? && @terminal_state !~ pattern
    invalid_properties.push("invalid value for \"terminal_state\", must conform to the pattern #{pattern}.")
  end

  if !@terminal_city.nil? && @terminal_city.to_s.length > 16
    invalid_properties.push('invalid value for "terminal_city", the character length must be smaller than or equal to 16.')
  end

  pattern = Regexp.new(/(?=.*[^\s])^[^|]+$/)
  if !@terminal_city.nil? && @terminal_city !~ pattern
    invalid_properties.push("invalid value for \"terminal_city\", must conform to the pattern #{pattern}.")
  end

  if @ach_bill_to.nil?
    invalid_properties.push('invalid value for "ach_bill_to", ach_bill_to cannot be nil.')
  end

  invalid_properties
end
product_code=(product_code) click to toggle source

Custom attribute writer method with validation @param [Object] product_code Value to be assigned

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 500
def product_code=(product_code)
  if !product_code.nil? && product_code.to_s.length > 6
    fail ArgumentError, 'invalid value for "product_code", the character length must be smaller than or equal to 6.'
  end

  pattern = Regexp.new(/^[0-9]+$/)
  if !product_code.nil? && product_code !~ pattern
    fail ArgumentError, "invalid value for \"product_code\", must conform to the pattern #{pattern}."
  end

  @product_code = product_code
end
registration_id=(registration_id) click to toggle source

Custom attribute writer method with validation @param [Object] registration_id Value to be assigned

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 545
def registration_id=(registration_id)
  if !registration_id.nil? && registration_id.to_s.length > 50
    fail ArgumentError, 'invalid value for "registration_id", the character length must be smaller than or equal to 50.'
  end

  pattern = Regexp.new(/(?=.*[^\s])^[^|]+$/)
  if !registration_id.nil? && registration_id !~ pattern
    fail ArgumentError, "invalid value for \"registration_id\", must conform to the pattern #{pattern}."
  end

  @registration_id = registration_id
end
release_type=(release_type) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] release_type Object to be assigned

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 560
def release_type=(release_type)
  validator = EnumAttributeValidator.new('String', ["C", "D", "P", "T"])
  unless validator.valid?(release_type)
    fail ArgumentError, "invalid value for \"release_type\", must be one of #{validator.allowable_values}."
  end
  @release_type = release_type
end
routing_number=(routing_number) click to toggle source

Custom attribute writer method with validation @param [Object] routing_number Value to be assigned

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 419
def routing_number=(routing_number)
  if routing_number.nil?
    fail ArgumentError, 'routing_number cannot be nil'
  end

  if routing_number.to_s.length > 9
    fail ArgumentError, 'invalid value for "routing_number", the character length must be smaller than or equal to 9.'
  end

  if routing_number.to_s.length < 9
    fail ArgumentError, 'invalid value for "routing_number", the character length must be great than or equal to 9.'
  end

  pattern = Regexp.new(/^[0-9]+$/)
  if routing_number !~ pattern
    fail ArgumentError, "invalid value for \"routing_number\", must conform to the pattern #{pattern}."
  end

  @routing_number = routing_number
end
session_id=(session_id) click to toggle source

Custom attribute writer method with validation @param [Object] session_id Value to be assigned

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 580
def session_id=(session_id)
  if session_id.nil?
    fail ArgumentError, 'session_id cannot be nil'
  end

  if session_id.to_s.length > 128
    fail ArgumentError, 'invalid value for "session_id", the character length must be smaller than or equal to 128.'
  end

  pattern = Regexp.new(/(?=.*[^\s])^[^|]+$/)
  if session_id !~ pattern
    fail ArgumentError, "invalid value for \"session_id\", must conform to the pattern #{pattern}."
  end

  @session_id = session_id
end
terminal_city=(terminal_city) click to toggle source

Custom attribute writer method with validation @param [Object] terminal_city Value to be assigned

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 614
def terminal_city=(terminal_city)
  if !terminal_city.nil? && terminal_city.to_s.length > 16
    fail ArgumentError, 'invalid value for "terminal_city", the character length must be smaller than or equal to 16.'
  end

  pattern = Regexp.new(/(?=.*[^\s])^[^|]+$/)
  if !terminal_city.nil? && terminal_city !~ pattern
    fail ArgumentError, "invalid value for \"terminal_city\", must conform to the pattern #{pattern}."
  end

  @terminal_city = terminal_city
end
terminal_id=(terminal_id) click to toggle source

Custom attribute writer method with validation @param [Object] terminal_id Value to be assigned

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 530
def terminal_id=(terminal_id)
  if !terminal_id.nil? && terminal_id.to_s.length > 10
    fail ArgumentError, 'invalid value for "terminal_id", the character length must be smaller than or equal to 10.'
  end

  pattern = Regexp.new(/^[0-9]+$/)
  if !terminal_id.nil? && terminal_id !~ pattern
    fail ArgumentError, "invalid value for \"terminal_id\", must conform to the pattern #{pattern}."
  end

  @terminal_id = terminal_id
end
terminal_state=(terminal_state) click to toggle source

Custom attribute writer method with validation @param [Object] terminal_state Value to be assigned

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 599
def terminal_state=(terminal_state)
  if !terminal_state.nil? && terminal_state.to_s.length > 2
    fail ArgumentError, 'invalid value for "terminal_state", the character length must be smaller than or equal to 2.'
  end

  pattern = Regexp.new(/^[A-Z]{2}$/)
  if !terminal_state.nil? && terminal_state !~ pattern
    fail ArgumentError, "invalid value for \"terminal_state\", must conform to the pattern #{pattern}."
  end

  @terminal_state = terminal_state
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 746
def to_body
  to_hash
end
to_hash(attribute_map = self.class.attribute_map, openapi_nullable = Set.new([])) click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 752
def to_hash(attribute_map = self.class.attribute_map, openapi_nullable = Set.new([]))
  hash = {}
  attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end
    
    hash[param] = _to_hash(value)
  end
  hash
end
to_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 740
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 376
def valid?
  return false if @ach_type.nil?
  return false if @routing_number.nil?
  return false if @routing_number.to_s.length > 9
  return false if @routing_number.to_s.length < 9
  return false if @routing_number !~ Regexp.new(/^[0-9]+$/)
  return false if @account_number.nil?
  return false if @account_number.to_s.length > 56
  return false if @account_number.to_s.length < 1
  return false if @account_number !~ Regexp.new(/^[0-9]+$/)
  return false if @account_type.nil?
  account_type_validator = EnumAttributeValidator.new('String', ["C", "S"])
  return false unless account_type_validator.valid?(@account_type)
  return false if !@check_number.nil? && @check_number.to_s.length > 10
  return false if !@check_number.nil? && @check_number !~ Regexp.new(/^[0-9]+$/)
  return false if @check_type.nil?
  check_type_validator = EnumAttributeValidator.new('String', ["P", "C"])
  return false unless check_type_validator.valid?(@check_type)
  return false if !@product_code.nil? && @product_code.to_s.length > 6
  return false if !@product_code.nil? && @product_code !~ Regexp.new(/^[0-9]+$/)
  return false if !@agent_id.nil? && @agent_id.to_s.length > 6
  return false if !@agent_id.nil? && @agent_id !~ Regexp.new(/(?=.*[^\s])^[^|]+$/)
  return false if !@terminal_id.nil? && @terminal_id.to_s.length > 10
  return false if !@terminal_id.nil? && @terminal_id !~ Regexp.new(/^[0-9]+$/)
  return false if !@registration_id.nil? && @registration_id.to_s.length > 50
  return false if !@registration_id.nil? && @registration_id !~ Regexp.new(/(?=.*[^\s])^[^|]+$/)
  release_type_validator = EnumAttributeValidator.new('String', ["C", "D", "P", "T"])
  return false unless release_type_validator.valid?(@release_type)
  vip_customer_validator = EnumAttributeValidator.new('String', ["Y", "N"])
  return false unless vip_customer_validator.valid?(@vip_customer)
  return false if @session_id.nil?
  return false if @session_id.to_s.length > 128
  return false if @session_id !~ Regexp.new(/(?=.*[^\s])^[^|]+$/)
  return false if !@terminal_state.nil? && @terminal_state.to_s.length > 2
  return false if !@terminal_state.nil? && @terminal_state !~ Regexp.new(/^[A-Z]{2}$/)
  return false if !@terminal_city.nil? && @terminal_city.to_s.length > 16
  return false if !@terminal_city.nil? && @terminal_city !~ Regexp.new(/(?=.*[^\s])^[^|]+$/)
  return false if @ach_bill_to.nil?
  true
end
vip_customer=(vip_customer) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] vip_customer Object to be assigned

# File lib/openapi_client/models/tele_check_ach_payment_method.rb, line 570
def vip_customer=(vip_customer)
  validator = EnumAttributeValidator.new('String', ["Y", "N"])
  unless validator.valid?(vip_customer)
    fail ArgumentError, "invalid value for \"vip_customer\", must be one of #{validator.allowable_values}."
  end
  @vip_customer = vip_customer
end