-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Бросаем исключение, если калькулятр доставки вернул нулевую стоимость
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/Dispatching/Endpoints/Services/Exceptions/CalculationException.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,24 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of RussianPost SDK package. | ||
* | ||
* © Appwilio (http://appwilio.com), greabock (https://github.com/greabock), JhaoDa (https://github.com/jhaoda) | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Appwilio\RussianPostSDK\Dispatching\Endpoints\Services\Exceptions; | ||
|
||
final class CalculationException extends \DomainException | ||
{ | ||
public const ZERO_TOTAL_RATE = 1; | ||
|
||
public static function becauseZeroTotalRate(): self | ||
{ | ||
return new self('Почта России вернула нулевой расчёт стоимости доставки.', self::ZERO_TOTAL_RATE); | ||
} | ||
} |
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