-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw invalid NIP exception in wFirma contractor book (#60)
This can be used to throw a specific exception when the contractor NIP (PL Vat Id) is invalid and wFirma returns an error response.
- Loading branch information
1 parent
a31e7cf
commit 684cab5
Showing
6 changed files
with
165 additions
and
55 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/Bookkeeping/Contractor/Exception/InvalidVatIdException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Landingi\BookkeepingBundle\Bookkeeping\Contractor\Exception; | ||
|
||
use RuntimeException; | ||
|
||
final class InvalidVatIdException extends RuntimeException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Landingi\BookkeepingBundle\Wfirma\Client\Exception; | ||
|
||
use Landingi\BookkeepingBundle\Wfirma\Client\WfirmaClientException; | ||
|
||
final class ErrorResponseException extends WfirmaClientException | ||
{ | ||
public function __construct(string $url, array $result, string $request) | ||
{ | ||
parent::__construct($url, $result, $request, 'External system returns an error'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
tests/Integration/Wfirma/Contractor/Resources/companies_invalid.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"companies": [ | ||
{ | ||
"id": "1234", | ||
"name": "Polish Company", | ||
"email": "[email protected]", | ||
"street": "Witkiewicza", | ||
"zip": "44-100", | ||
"city": "Gliwice", | ||
"country": "PL", | ||
"nip": "12345678" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters