Skip to content

Commit

Permalink
Allow alphanumeric Company ID
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcasiro committed Nov 10, 2018
1 parent 62400c1 commit 31ad980
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 170 deletions.
2 changes: 1 addition & 1 deletion src/ACH/BatchControlRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected static function getFieldSpecifications(): array
],
self::COMPANY_ID => [
self::FIELD_INCLUSION => self::FIELD_INCLUSION_REQUIRED,
self::VALIDATOR => [self::VALIDATOR_REGEX, '/^\d{10}$/'],
self::VALIDATOR => [self::VALIDATOR_REGEX, '/^[a-zA-Z0-9]{10}$/'],
self::LENGTH => 10,
self::POSITION_START => 45,
self::POSITION_END => 54,
Expand Down
2 changes: 1 addition & 1 deletion src/ACH/BatchHeaderRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ protected static function getFieldSpecifications(): array
],
self::COMPANY_ID => [
self::FIELD_INCLUSION => self::FIELD_INCLUSION_MANDATORY,
self::VALIDATOR => [self::VALIDATOR_REGEX, '/^\d{10}$/'],
self::VALIDATOR => [self::VALIDATOR_REGEX, '/^[a-zA-Z0-9]{10}$/'],
self::LENGTH => 10,
self::POSITION_START => 41,
self::POSITION_END => 50,
Expand Down
9 changes: 3 additions & 6 deletions tests/ACH/BatchControlRecordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class BatchControlRecordTest extends TestCase
public function validInputsProvider()
{
return [
[
// No Entry Detail Records
'No Entry Detail Records' => [
[
BatchHeaderRecord::class => new BatchHeaderRecord([
BatchHeaderRecord::SERVICE_CLASS_CODE => BatchHeaderRecord::MIXED_SERVICE_CLASS,
Expand All @@ -55,8 +54,7 @@ public function validInputsProvider()
],
'820000000000000000000000000000000000000000000123456789 876543210000001',
],
[
// Single Entry Detail Record
'Single Entry Detail Record' => [
[
BatchHeaderRecord::class => new BatchHeaderRecord([
BatchHeaderRecord::SERVICE_CLASS_CODE => BatchHeaderRecord::MIXED_SERVICE_CLASS,
Expand All @@ -82,8 +80,7 @@ public function validInputsProvider()
],
'820000000100113000020000000000000000000011000123456789 876543210000001',
],
[
// Multiple Entry Detail Records
'Multiple Entry Detail Records' => [
[
BatchHeaderRecord::class => new BatchHeaderRecord([
BatchHeaderRecord::SERVICE_CLASS_CODE => BatchHeaderRecord::MIXED_SERVICE_CLASS,
Expand Down
Loading

0 comments on commit 31ad980

Please sign in to comment.