Class: Nacha::Record::BatchControl

Inherits:
Base
  • Object
show all
Includes:
BatchControlRecordType
Defined in:
lib/nacha/record/batch_control.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#children, #fields, #line_number, #name, #original_input_line, #parent, #validations

Method Summary

Methods included from BatchControlRecordType

#child_record_types, included

Methods inherited from Base

#add_error, #create_fields_from_definition, #credit?, #debit?, definition, #definition, #errors, #human_name, #initialize, #inspect, matcher, #method_missing, nacha_field, parse, #record_type, record_type, #respond_to_missing?, #to_ach, #to_h, to_h, #to_html, to_json, #to_json, unpack_str, #valid?, #validate, validations

Methods included from Validations::FieldValidations

included

Constructor Details

This class inherits a constructor from Nacha::Record::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Nacha::Record::Base

Instance Attribute Details

#batch_numberNacha::Numeric

Returns A number assigned by the ODFI to uniquely identify the batch.

Returns:

  • (Nacha::Numeric)

    A number assigned by the ODFI to uniquely identify the batch.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/nacha/record/batch_control.rb', line 31

class BatchControl < Nacha::Record::Base
  include BatchControlRecordType

  nacha_field :record_type_code, inclusion: 'M', contents: 'C8', position: 1..1
  nacha_field :service_class_code, inclusion: 'M', contents: 'Numeric', position: 2..4
  nacha_field :entry_addenda_count, inclusion: 'M', contents: 'Numeric', position: 5..10
  nacha_field :entry_hash, inclusion: 'M', contents: 'Numeric', position: 11..20
  nacha_field :total_debit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 21..32
  nacha_field :total_credit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 33..44
  nacha_field :company_identification,
    inclusion: 'R', contents: 'Alphameric', position: 45..54
  nacha_field :message_authentication_code,
    inclusion: 'O', contents: 'Alphameric', position: 55..73
  nacha_field :reserved, inclusion: 'O', contents: 'C      ', position: 74..79
  nacha_field :originating_dfi_identification,
    inclusion: 'M', contents: 'TTTTAAAA', position: 80..87
  nacha_field :batch_number, inclusion: 'M', contents: 'Numeric', position: 88..94
end

#company_identificationString

Returns The identifier for the company that originated the entries in the batch.

Returns:

  • (String)

    The identifier for the company that originated the entries in the batch.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/nacha/record/batch_control.rb', line 31

class BatchControl < Nacha::Record::Base
  include BatchControlRecordType

  nacha_field :record_type_code, inclusion: 'M', contents: 'C8', position: 1..1
  nacha_field :service_class_code, inclusion: 'M', contents: 'Numeric', position: 2..4
  nacha_field :entry_addenda_count, inclusion: 'M', contents: 'Numeric', position: 5..10
  nacha_field :entry_hash, inclusion: 'M', contents: 'Numeric', position: 11..20
  nacha_field :total_debit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 21..32
  nacha_field :total_credit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 33..44
  nacha_field :company_identification,
    inclusion: 'R', contents: 'Alphameric', position: 45..54
  nacha_field :message_authentication_code,
    inclusion: 'O', contents: 'Alphameric', position: 55..73
  nacha_field :reserved, inclusion: 'O', contents: 'C      ', position: 74..79
  nacha_field :originating_dfi_identification,
    inclusion: 'M', contents: 'TTTTAAAA', position: 80..87
  nacha_field :batch_number, inclusion: 'M', contents: 'Numeric', position: 88..94
end

#entry_addenda_countNacha::Numeric

Returns The total count of entry detail and addenda records within the batch.

Returns:

  • (Nacha::Numeric)

    The total count of entry detail and addenda records within the batch.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/nacha/record/batch_control.rb', line 31

class BatchControl < Nacha::Record::Base
  include BatchControlRecordType

  nacha_field :record_type_code, inclusion: 'M', contents: 'C8', position: 1..1
  nacha_field :service_class_code, inclusion: 'M', contents: 'Numeric', position: 2..4
  nacha_field :entry_addenda_count, inclusion: 'M', contents: 'Numeric', position: 5..10
  nacha_field :entry_hash, inclusion: 'M', contents: 'Numeric', position: 11..20
  nacha_field :total_debit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 21..32
  nacha_field :total_credit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 33..44
  nacha_field :company_identification,
    inclusion: 'R', contents: 'Alphameric', position: 45..54
  nacha_field :message_authentication_code,
    inclusion: 'O', contents: 'Alphameric', position: 55..73
  nacha_field :reserved, inclusion: 'O', contents: 'C      ', position: 74..79
  nacha_field :originating_dfi_identification,
    inclusion: 'M', contents: 'TTTTAAAA', position: 80..87
  nacha_field :batch_number, inclusion: 'M', contents: 'Numeric', position: 88..94
end

#entry_hashNacha::Numeric

Returns A hash total of the routing numbers of all entry detail records in the batch for validation.

Returns:

  • (Nacha::Numeric)

    A hash total of the routing numbers of all entry detail records in the batch for validation.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/nacha/record/batch_control.rb', line 31

class BatchControl < Nacha::Record::Base
  include BatchControlRecordType

  nacha_field :record_type_code, inclusion: 'M', contents: 'C8', position: 1..1
  nacha_field :service_class_code, inclusion: 'M', contents: 'Numeric', position: 2..4
  nacha_field :entry_addenda_count, inclusion: 'M', contents: 'Numeric', position: 5..10
  nacha_field :entry_hash, inclusion: 'M', contents: 'Numeric', position: 11..20
  nacha_field :total_debit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 21..32
  nacha_field :total_credit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 33..44
  nacha_field :company_identification,
    inclusion: 'R', contents: 'Alphameric', position: 45..54
  nacha_field :message_authentication_code,
    inclusion: 'O', contents: 'Alphameric', position: 55..73
  nacha_field :reserved, inclusion: 'O', contents: 'C      ', position: 74..79
  nacha_field :originating_dfi_identification,
    inclusion: 'M', contents: 'TTTTAAAA', position: 80..87
  nacha_field :batch_number, inclusion: 'M', contents: 'Numeric', position: 88..94
end

#message_authentication_codeString

Returns A code used to authenticate the batch, if required by the ODFI.

Returns:

  • (String)

    A code used to authenticate the batch, if required by the ODFI.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/nacha/record/batch_control.rb', line 31

class BatchControl < Nacha::Record::Base
  include BatchControlRecordType

  nacha_field :record_type_code, inclusion: 'M', contents: 'C8', position: 1..1
  nacha_field :service_class_code, inclusion: 'M', contents: 'Numeric', position: 2..4
  nacha_field :entry_addenda_count, inclusion: 'M', contents: 'Numeric', position: 5..10
  nacha_field :entry_hash, inclusion: 'M', contents: 'Numeric', position: 11..20
  nacha_field :total_debit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 21..32
  nacha_field :total_credit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 33..44
  nacha_field :company_identification,
    inclusion: 'R', contents: 'Alphameric', position: 45..54
  nacha_field :message_authentication_code,
    inclusion: 'O', contents: 'Alphameric', position: 55..73
  nacha_field :reserved, inclusion: 'O', contents: 'C      ', position: 74..79
  nacha_field :originating_dfi_identification,
    inclusion: 'M', contents: 'TTTTAAAA', position: 80..87
  nacha_field :batch_number, inclusion: 'M', contents: 'Numeric', position: 88..94
end

#originating_dfi_identificationString

Returns The 8-digit routing number of the financial institution originating the batch.

Returns:

  • (String)

    The 8-digit routing number of the financial institution originating the batch.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/nacha/record/batch_control.rb', line 31

class BatchControl < Nacha::Record::Base
  include BatchControlRecordType

  nacha_field :record_type_code, inclusion: 'M', contents: 'C8', position: 1..1
  nacha_field :service_class_code, inclusion: 'M', contents: 'Numeric', position: 2..4
  nacha_field :entry_addenda_count, inclusion: 'M', contents: 'Numeric', position: 5..10
  nacha_field :entry_hash, inclusion: 'M', contents: 'Numeric', position: 11..20
  nacha_field :total_debit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 21..32
  nacha_field :total_credit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 33..44
  nacha_field :company_identification,
    inclusion: 'R', contents: 'Alphameric', position: 45..54
  nacha_field :message_authentication_code,
    inclusion: 'O', contents: 'Alphameric', position: 55..73
  nacha_field :reserved, inclusion: 'O', contents: 'C      ', position: 74..79
  nacha_field :originating_dfi_identification,
    inclusion: 'M', contents: 'TTTTAAAA', position: 80..87
  nacha_field :batch_number, inclusion: 'M', contents: 'Numeric', position: 88..94
end

#record_type_codeString

Returns Identifies the record as a Batch Control record with a constant value of ‘8’.

Returns:

  • (String)

    Identifies the record as a Batch Control record with a constant value of ‘8’.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/nacha/record/batch_control.rb', line 31

class BatchControl < Nacha::Record::Base
  include BatchControlRecordType

  nacha_field :record_type_code, inclusion: 'M', contents: 'C8', position: 1..1
  nacha_field :service_class_code, inclusion: 'M', contents: 'Numeric', position: 2..4
  nacha_field :entry_addenda_count, inclusion: 'M', contents: 'Numeric', position: 5..10
  nacha_field :entry_hash, inclusion: 'M', contents: 'Numeric', position: 11..20
  nacha_field :total_debit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 21..32
  nacha_field :total_credit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 33..44
  nacha_field :company_identification,
    inclusion: 'R', contents: 'Alphameric', position: 45..54
  nacha_field :message_authentication_code,
    inclusion: 'O', contents: 'Alphameric', position: 55..73
  nacha_field :reserved, inclusion: 'O', contents: 'C      ', position: 74..79
  nacha_field :originating_dfi_identification,
    inclusion: 'M', contents: 'TTTTAAAA', position: 80..87
  nacha_field :batch_number, inclusion: 'M', contents: 'Numeric', position: 88..94
end

#reservedString

Returns A reserved field for future use.

Returns:

  • (String)

    A reserved field for future use.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/nacha/record/batch_control.rb', line 31

class BatchControl < Nacha::Record::Base
  include BatchControlRecordType

  nacha_field :record_type_code, inclusion: 'M', contents: 'C8', position: 1..1
  nacha_field :service_class_code, inclusion: 'M', contents: 'Numeric', position: 2..4
  nacha_field :entry_addenda_count, inclusion: 'M', contents: 'Numeric', position: 5..10
  nacha_field :entry_hash, inclusion: 'M', contents: 'Numeric', position: 11..20
  nacha_field :total_debit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 21..32
  nacha_field :total_credit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 33..44
  nacha_field :company_identification,
    inclusion: 'R', contents: 'Alphameric', position: 45..54
  nacha_field :message_authentication_code,
    inclusion: 'O', contents: 'Alphameric', position: 55..73
  nacha_field :reserved, inclusion: 'O', contents: 'C      ', position: 74..79
  nacha_field :originating_dfi_identification,
    inclusion: 'M', contents: 'TTTTAAAA', position: 80..87
  nacha_field :batch_number, inclusion: 'M', contents: 'Numeric', position: 88..94
end

#service_class_codeNacha::Numeric

Returns Specifies the type of entries in the batch (e.g., credits, debits, or mixed).

Returns:

  • (Nacha::Numeric)

    Specifies the type of entries in the batch (e.g., credits, debits, or mixed).



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/nacha/record/batch_control.rb', line 31

class BatchControl < Nacha::Record::Base
  include BatchControlRecordType

  nacha_field :record_type_code, inclusion: 'M', contents: 'C8', position: 1..1
  nacha_field :service_class_code, inclusion: 'M', contents: 'Numeric', position: 2..4
  nacha_field :entry_addenda_count, inclusion: 'M', contents: 'Numeric', position: 5..10
  nacha_field :entry_hash, inclusion: 'M', contents: 'Numeric', position: 11..20
  nacha_field :total_debit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 21..32
  nacha_field :total_credit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 33..44
  nacha_field :company_identification,
    inclusion: 'R', contents: 'Alphameric', position: 45..54
  nacha_field :message_authentication_code,
    inclusion: 'O', contents: 'Alphameric', position: 55..73
  nacha_field :reserved, inclusion: 'O', contents: 'C      ', position: 74..79
  nacha_field :originating_dfi_identification,
    inclusion: 'M', contents: 'TTTTAAAA', position: 80..87
  nacha_field :batch_number, inclusion: 'M', contents: 'Numeric', position: 88..94
end

#total_credit_entry_dollar_amountNacha::Numeric

Returns The total dollar amount of all credit entries in the batch.

Returns:

  • (Nacha::Numeric)

    The total dollar amount of all credit entries in the batch.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/nacha/record/batch_control.rb', line 31

class BatchControl < Nacha::Record::Base
  include BatchControlRecordType

  nacha_field :record_type_code, inclusion: 'M', contents: 'C8', position: 1..1
  nacha_field :service_class_code, inclusion: 'M', contents: 'Numeric', position: 2..4
  nacha_field :entry_addenda_count, inclusion: 'M', contents: 'Numeric', position: 5..10
  nacha_field :entry_hash, inclusion: 'M', contents: 'Numeric', position: 11..20
  nacha_field :total_debit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 21..32
  nacha_field :total_credit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 33..44
  nacha_field :company_identification,
    inclusion: 'R', contents: 'Alphameric', position: 45..54
  nacha_field :message_authentication_code,
    inclusion: 'O', contents: 'Alphameric', position: 55..73
  nacha_field :reserved, inclusion: 'O', contents: 'C      ', position: 74..79
  nacha_field :originating_dfi_identification,
    inclusion: 'M', contents: 'TTTTAAAA', position: 80..87
  nacha_field :batch_number, inclusion: 'M', contents: 'Numeric', position: 88..94
end

#total_debit_entry_dollar_amountNacha::Numeric

Returns The total dollar amount of all debit entries in the batch.

Returns:

  • (Nacha::Numeric)

    The total dollar amount of all debit entries in the batch.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/nacha/record/batch_control.rb', line 31

class BatchControl < Nacha::Record::Base
  include BatchControlRecordType

  nacha_field :record_type_code, inclusion: 'M', contents: 'C8', position: 1..1
  nacha_field :service_class_code, inclusion: 'M', contents: 'Numeric', position: 2..4
  nacha_field :entry_addenda_count, inclusion: 'M', contents: 'Numeric', position: 5..10
  nacha_field :entry_hash, inclusion: 'M', contents: 'Numeric', position: 11..20
  nacha_field :total_debit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 21..32
  nacha_field :total_credit_entry_dollar_amount,
    inclusion: 'M', contents: '$$$$$$$$$$¢¢', position: 33..44
  nacha_field :company_identification,
    inclusion: 'R', contents: 'Alphameric', position: 45..54
  nacha_field :message_authentication_code,
    inclusion: 'O', contents: 'Alphameric', position: 55..73
  nacha_field :reserved, inclusion: 'O', contents: 'C      ', position: 74..79
  nacha_field :originating_dfi_identification,
    inclusion: 'M', contents: 'TTTTAAAA', position: 80..87
  nacha_field :batch_number, inclusion: 'M', contents: 'Numeric', position: 88..94
end