Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Banking/Operation.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function __construct(
private readonly ?string $currencyCode,
private readonly ?string $rejectCode,
private readonly ?string $exemptCode,
private readonly ?string $bankOperationReference,
) {
$this->details = [];
}
Expand Down Expand Up @@ -104,6 +105,11 @@ public function getAmount(): float
return $this->amount;
}

public function getBankOperationReference(): ?string
{
return $this->bankOperationReference;
}

public function addDetails(OperationDetail $details): self
{
$this->details[] = $details;
Expand Down
5 changes: 3 additions & 2 deletions src/Parser/Cfonb120/Line04Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct()
'exempt_code' => new RegexParts(LineParser::ALL, 1),
'_unused_3' => new RegexParts(LineParser::ALL, 1),
'amount' => new RegexParts(LineParser::AMOUNT, 13),
'_unused_5' => new RegexParts(LineParser::ALL, 16),
'bank_operation_reference' => new RegexParts(LineParser::ALPHANUMERIC_BLANK, 16),
]);
}

Expand All @@ -71,7 +71,8 @@ public function parse(string $content, bool $strict): Operation
$regexMatch->getStringOrNull('internal_code'),
$regexMatch->getStringOrNull('currency_code'),
$regexMatch->getStringOrNull('reject_code'),
$regexMatch->getStringOrNull('exempt_code')
$regexMatch->getStringOrNull('exempt_code'),
$regexMatch->getStringOrNull('bank_operation_reference')
);
}

Expand Down
4 changes: 3 additions & 1 deletion tests/Banking/OperationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public function testGetter()
'test7',
'test8',
'test9',
'test10'
'test10',
'test11',
);

self::assertSame('test', $sUT->getBankCode());
Expand All @@ -56,6 +57,7 @@ public function testGetter()
self::assertSame('test8', $sUT->getCurrencyCode());
self::assertSame('test9', $sUT->getRejectCode());
self::assertSame('test10', $sUT->getExemptCode());
self::assertSame('test11', $sUT->getBankOperationReference());
self::assertCount(0, $sUT->getDetails());

$detail = $this->createMock(OperationDetail::class);
Expand Down