From 926ce997ea58f0a98288c8d12535a87116b8652c Mon Sep 17 00:00:00 2001 From: Pablo Reyes Date: Wed, 29 Sep 2021 18:03:08 -0300 Subject: [PATCH] HOTFIX/account_number_via_clabe (#12) --- CHANGELOG.md | 5 +++++ src/Mx/MxBankAccount.php | 2 +- tests/Mx/MxBankAccountTest.php | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6595c70..ac3402c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.1.2] - 2021-09-29 + ### Added - Github actions added +### Fixed +- Get mexican account number via CLABE. + ## [1.1.1] - 2021-06-21 ### Fixed diff --git a/src/Mx/MxBankAccount.php b/src/Mx/MxBankAccount.php index 4198d02..d6e8118 100644 --- a/src/Mx/MxBankAccount.php +++ b/src/Mx/MxBankAccount.php @@ -68,6 +68,6 @@ public function getInternalBankAccountNumber(): ?string return null; } - return substr($this->getBankAccountNumber(), 6, 11); + return substr($this->getBankAccountNumber(), 7, 10); } } diff --git a/tests/Mx/MxBankAccountTest.php b/tests/Mx/MxBankAccountTest.php index 9ef03c6..1ba6389 100644 --- a/tests/Mx/MxBankAccountTest.php +++ b/tests/Mx/MxBankAccountTest.php @@ -41,7 +41,8 @@ public function testBankName() public function testGetInternalBankAccountNumber() { - static::assertSame('01031285017', (new MxBankAccount('072580010312850172'))->getInternalBankAccountNumber()); + static::assertSame('1031285017', (new MxBankAccount('072580010312850172'))->getInternalBankAccountNumber()); + static::assertSame('1507317570', (new MxBankAccount('012694015073175704'))->getInternalBankAccountNumber()); static::assertNull((new MxBankAccount('123'))->getInternalBankAccountNumber()); }