class UltracartClient::OrderPaymentECheck

Attributes

bank_aba_code[RW]

Bank routing code

bank_account_name[RW]

Bank account name

bank_account_number[RW]

Bank account number (masked to last 4)

bank_account_type[RW]

Bank account type

bank_name[RW]

Bank name

bank_owner_type[RW]

Bank owner type

customer_tax_id[RW]

Customer tax id (masked to last 4)

drivers_license_dob[RW]

Driver license date of birth

drivers_license_number[RW]

Driver license number (masked to last 4)

drivers_license_state[RW]

Driver license state

Public Class Methods

attribute_map() click to toggle source

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

# File lib/ultracart_api/models/order_payment_e_check.rb, line 70
def self.attribute_map
  {
    :'bank_aba_code' => :'bank_aba_code',
    :'bank_account_name' => :'bank_account_name',
    :'bank_account_number' => :'bank_account_number',
    :'bank_account_type' => :'bank_account_type',
    :'bank_name' => :'bank_name',
    :'bank_owner_type' => :'bank_owner_type',
    :'customer_tax_id' => :'customer_tax_id',
    :'drivers_license_dob' => :'drivers_license_dob',
    :'drivers_license_number' => :'drivers_license_number',
    :'drivers_license_state' => :'drivers_license_state'
  }
end
new(attributes = {}) click to toggle source

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

# File lib/ultracart_api/models/order_payment_e_check.rb, line 103
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'bank_aba_code')
    self.bank_aba_code = attributes[:'bank_aba_code']
  end

  if attributes.has_key?(:'bank_account_name')
    self.bank_account_name = attributes[:'bank_account_name']
  end

  if attributes.has_key?(:'bank_account_number')
    self.bank_account_number = attributes[:'bank_account_number']
  end

  if attributes.has_key?(:'bank_account_type')
    self.bank_account_type = attributes[:'bank_account_type']
  end

  if attributes.has_key?(:'bank_name')
    self.bank_name = attributes[:'bank_name']
  end

  if attributes.has_key?(:'bank_owner_type')
    self.bank_owner_type = attributes[:'bank_owner_type']
  end

  if attributes.has_key?(:'customer_tax_id')
    self.customer_tax_id = attributes[:'customer_tax_id']
  end

  if attributes.has_key?(:'drivers_license_dob')
    self.drivers_license_dob = attributes[:'drivers_license_dob']
  end

  if attributes.has_key?(:'drivers_license_number')
    self.drivers_license_number = attributes[:'drivers_license_number']
  end

  if attributes.has_key?(:'drivers_license_state')
    self.drivers_license_state = attributes[:'drivers_license_state']
  end
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/ultracart_api/models/order_payment_e_check.rb, line 86
def self.swagger_types
  {
    :'bank_aba_code' => :'String',
    :'bank_account_name' => :'String',
    :'bank_account_number' => :'String',
    :'bank_account_type' => :'String',
    :'bank_name' => :'String',
    :'bank_owner_type' => :'String',
    :'customer_tax_id' => :'String',
    :'drivers_license_dob' => :'String',
    :'drivers_license_number' => :'String',
    :'drivers_license_state' => :'String'
  }
end

Public Instance Methods

==(o) click to toggle source

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

# File lib/ultracart_api/models/order_payment_e_check.rb, line 309
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      bank_aba_code == o.bank_aba_code &&
      bank_account_name == o.bank_account_name &&
      bank_account_number == o.bank_account_number &&
      bank_account_type == o.bank_account_type &&
      bank_name == o.bank_name &&
      bank_owner_type == o.bank_owner_type &&
      customer_tax_id == o.customer_tax_id &&
      drivers_license_dob == o.drivers_license_dob &&
      drivers_license_number == o.drivers_license_number &&
      drivers_license_state == o.drivers_license_state
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/ultracart_api/models/order_payment_e_check.rb, line 360
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
    temp_model = UltracartClient.const_get(type).new
    temp_model.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/ultracart_api/models/order_payment_e_check.rb, line 426
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
bank_aba_code=(bank_aba_code) click to toggle source

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

# File lib/ultracart_api/models/order_payment_e_check.rb, line 209
def bank_aba_code=(bank_aba_code)
  if !bank_aba_code.nil? && bank_aba_code.to_s.length > 9
    fail ArgumentError, 'invalid value for "bank_aba_code", the character length must be smaller than or equal to 9.'
  end

  @bank_aba_code = bank_aba_code
end
bank_account_name=(bank_account_name) click to toggle source

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

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

  @bank_account_name = bank_account_name
end
bank_account_number=(bank_account_number) click to toggle source

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

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

  @bank_account_number = bank_account_number
end
bank_account_type=(bank_account_type) click to toggle source

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

# File lib/ultracart_api/models/order_payment_e_check.rb, line 239
def bank_account_type=(bank_account_type)
  validator = EnumAttributeValidator.new('String', ['Checking', 'Savings'])
  unless validator.valid?(bank_account_type)
    fail ArgumentError, 'invalid value for "bank_account_type", must be one of #{validator.allowable_values}.'
  end
  @bank_account_type = bank_account_type
end
bank_name=(bank_name) click to toggle source

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

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

  @bank_name = bank_name
end
bank_owner_type=(bank_owner_type) click to toggle source

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

# File lib/ultracart_api/models/order_payment_e_check.rb, line 259
def bank_owner_type=(bank_owner_type)
  validator = EnumAttributeValidator.new('String', ['Personal', 'Business'])
  unless validator.valid?(bank_owner_type)
    fail ArgumentError, 'invalid value for "bank_owner_type", must be one of #{validator.allowable_values}.'
  end
  @bank_owner_type = bank_owner_type
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/ultracart_api/models/order_payment_e_check.rb, line 339
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_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[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end
customer_tax_id=(customer_tax_id) click to toggle source

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

# File lib/ultracart_api/models/order_payment_e_check.rb, line 269
def customer_tax_id=(customer_tax_id)
  if !customer_tax_id.nil? && customer_tax_id.to_s.length > 9
    fail ArgumentError, 'invalid value for "customer_tax_id", the character length must be smaller than or equal to 9.'
  end

  @customer_tax_id = customer_tax_id
end
drivers_license_dob=(drivers_license_dob) click to toggle source

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

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

  @drivers_license_dob = drivers_license_dob
end
drivers_license_number=(drivers_license_number) click to toggle source

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

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

  @drivers_license_number = drivers_license_number
end
drivers_license_state=(drivers_license_state) click to toggle source

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

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

  @drivers_license_state = drivers_license_state
end
eql?(o) click to toggle source

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

# File lib/ultracart_api/models/order_payment_e_check.rb, line 326
def eql?(o)
  self == o
end
hash() click to toggle source

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

# File lib/ultracart_api/models/order_payment_e_check.rb, line 332
def hash
  [bank_aba_code, bank_account_name, bank_account_number, bank_account_type, bank_name, bank_owner_type, customer_tax_id, drivers_license_dob, drivers_license_number, drivers_license_state].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/ultracart_api/models/order_payment_e_check.rb, line 152
def list_invalid_properties
  invalid_properties = Array.new
  if !@bank_aba_code.nil? && @bank_aba_code.to_s.length > 9
    invalid_properties.push('invalid value for "bank_aba_code", the character length must be smaller than or equal to 9.')
  end

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

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

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

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

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

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

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

  invalid_properties
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/ultracart_api/models/order_payment_e_check.rb, line 406
def to_body
  to_hash
end
to_hash() click to toggle source

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

# File lib/ultracart_api/models/order_payment_e_check.rb, line 412
def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    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/ultracart_api/models/order_payment_e_check.rb, line 400
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/ultracart_api/models/order_payment_e_check.rb, line 191
def valid?
  return false if !@bank_aba_code.nil? && @bank_aba_code.to_s.length > 9
  return false if !@bank_account_name.nil? && @bank_account_name.to_s.length > 50
  return false if !@bank_account_number.nil? && @bank_account_number.to_s.length > 50
  bank_account_type_validator = EnumAttributeValidator.new('String', ['Checking', 'Savings'])
  return false unless bank_account_type_validator.valid?(@bank_account_type)
  return false if !@bank_name.nil? && @bank_name.to_s.length > 50
  bank_owner_type_validator = EnumAttributeValidator.new('String', ['Personal', 'Business'])
  return false unless bank_owner_type_validator.valid?(@bank_owner_type)
  return false if !@customer_tax_id.nil? && @customer_tax_id.to_s.length > 9
  return false if !@drivers_license_dob.nil? && @drivers_license_dob.to_s.length > 10
  return false if !@drivers_license_number.nil? && @drivers_license_number.to_s.length > 50
  return false if !@drivers_license_state.nil? && @drivers_license_state.to_s.length > 2
  true
end