Class: SyncteraRubySdk::OutgoingAchRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/synctera_ruby_sdk/models/outgoing_ach_request.rb

Overview

Send an ACH

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OutgoingAchRequest

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 158

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `SyncteraRubySdk::OutgoingAchRequest` 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 `SyncteraRubySdk::OutgoingAchRequest`. 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?(:'amount')
    self.amount = attributes[:'amount']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.key?(:'sec_code')
    self.sec_code = attributes[:'sec_code']
  else
    self.sec_code = 'WEB'
  end
end

Instance Attribute Details

#amountObject

Amount to transfer in ISO 4217 minor currency units



20
21
22
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 20

def amount
  @amount
end

#company_entry_descriptionObject

Company Entry Description field in ACH batch header. Originator inserts this field’s value to provide the Receiver with a description of the entry’s purpose.



23
24
25
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 23

def company_entry_description
  @company_entry_description
end

#company_nameObject

Overrides the ‘Company Name’ field in ACH batch header, which otherwise defaults to the configured partner name.



26
27
28
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 26

def company_name
  @company_name
end

#currencyObject

ISO 4217 alphabetic currency code of the transfer amount



29
30
31
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 29

def currency
  @currency
end

#customer_idObject

The customer’s unique identifier



32
33
34
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 32

def customer_id
  @customer_id
end

#dc_signObject

The type of transaction (debit or credit). A debit is a transfer in and a credit is a transfer out of the originating account



35
36
37
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 35

def dc_sign
  @dc_sign
end

#effective_dateObject

Effective date transaction proccesses (is_same_day needs to be false or not present at all)



38
39
40
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 38

def effective_date
  @effective_date
end

#external_dataObject

Additional transfer metadata structured as key-value pairs



41
42
43
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 41

def external_data
  @external_data
end

#final_customer_idObject

ID of the international customer that receives the final remittance transfer (required for OFAC enabled payments)



44
45
46
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 44

def final_customer_id
  @final_customer_id
end

#holdObject

Returns the value of attribute hold.



46
47
48
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 46

def hold
  @hold
end

#is_same_dayObject

Send as same day ACH transaction (use only is_same_day without specific effective_date)



49
50
51
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 49

def is_same_day
  @is_same_day
end

#memoObject

Memo for the payment



52
53
54
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 52

def memo
  @memo
end

#originating_account_idObject

The unique identifier for an originating account



55
56
57
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 55

def 
  @originating_account_id
end

#receiving_account_idObject

The unique identifier for an receiving account



58
59
60
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 58

def 
  @receiving_account_id
end

#reference_infoObject

Will be sent to the ACH network and maps to Addenda record 05 - the recipient bank will receive this info



61
62
63
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 61

def reference_info
  @reference_info
end

#riskObject

Returns the value of attribute risk.



63
64
65
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 63

def risk
  @risk
end

#sec_codeObject

Standard Entry Class Code: * WEB: Internet initiated / Mobile Entry (default if empty) * CCD: Corporate Credit or Debit



66
67
68
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 66

def sec_code
  @sec_code
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



114
115
116
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 114

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 91

def self.attribute_map
  {
    :'amount' => :'amount',
    :'company_entry_description' => :'company_entry_description',
    :'company_name' => :'company_name',
    :'currency' => :'currency',
    :'customer_id' => :'customer_id',
    :'dc_sign' => :'dc_sign',
    :'effective_date' => :'effective_date',
    :'external_data' => :'external_data',
    :'final_customer_id' => :'final_customer_id',
    :'hold' => :'hold',
    :'is_same_day' => :'is_same_day',
    :'memo' => :'memo',
    :'originating_account_id' => :'originating_account_id',
    :'receiving_account_id' => :'receiving_account_id',
    :'reference_info' => :'reference_info',
    :'risk' => :'risk',
    :'sec_code' => :'sec_code'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



378
379
380
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 378

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 142

def self.openapi_nullable
  Set.new([
    :'company_entry_description',
    :'effective_date',
    :'external_data',
    :'final_customer_id',
    :'hold',
    :'is_same_day',
    :'memo',
    :'reference_info',
    :'risk',
  ])
end

.openapi_typesObject

Attribute type mapping.



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 119

def self.openapi_types
  {
    :'amount' => :'Integer',
    :'company_entry_description' => :'String',
    :'company_name' => :'String',
    :'currency' => :'String',
    :'customer_id' => :'String',
    :'dc_sign' => :'String',
    :'effective_date' => :'Date',
    :'external_data' => :'Object',
    :'final_customer_id' => :'String',
    :'hold' => :'AchRequestHoldData',
    :'is_same_day' => :'Boolean',
    :'memo' => :'String',
    :'originating_account_id' => :'String',
    :'receiving_account_id' => :'String',
    :'reference_info' => :'String',
    :'risk' => :'RiskData',
    :'sec_code' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 341

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      amount == o.amount &&
      company_entry_description == o.company_entry_description &&
      company_name == o.company_name &&
      currency == o.currency &&
      customer_id == o.customer_id &&
      dc_sign == o.dc_sign &&
      effective_date == o.effective_date &&
      external_data == o.external_data &&
      final_customer_id == o.final_customer_id &&
      hold == o.hold &&
      is_same_day == o.is_same_day &&
      memo == o.memo &&
       == o. &&
       == o. &&
      reference_info == o.reference_info &&
      risk == o.risk &&
      sec_code == o.sec_code
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 409

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.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
    # models (e.g. Pet) or oneOf
    klass = SyncteraRubySdk.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



480
481
482
483
484
485
486
487
488
489
490
491
492
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 480

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

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 385

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif 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
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


365
366
367
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 365

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



371
372
373
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 371

def hash
  [amount, company_entry_description, company_name, currency, customer_id, dc_sign, effective_date, external_data, final_customer_id, hold, is_same_day, memo, , , reference_info, risk, sec_code].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 244

def list_invalid_properties
  invalid_properties = Array.new
  if @amount.nil?
    invalid_properties.push('invalid value for "amount", amount cannot be nil.')
  end

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

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

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

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

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

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

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

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



456
457
458
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 456

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 462

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



450
451
452
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 450

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/synctera_ruby_sdk/models/outgoing_ach_request.rb', line 283

def valid?
  return false if @amount.nil?
  return false if !@company_entry_description.nil? && @company_entry_description.to_s.length > 10
  return false if !@company_name.nil? && @company_name.to_s.length > 16
  return false if @currency.nil?
  return false if @customer_id.nil?
  return false if @dc_sign.nil?
  dc_sign_validator = EnumAttributeValidator.new('String', ["debit", "credit"])
  return false unless dc_sign_validator.valid?(@dc_sign)
  return false if @originating_account_id.nil?
  return false if @receiving_account_id.nil?
  sec_code_validator = EnumAttributeValidator.new('String', ["WEB", "CCD"])
  return false unless sec_code_validator.valid?(@sec_code)
  true
end