Skip to content

Commit 9034d34

Browse files
authored
Allow negative VAT values
1 parent 9e30139 commit 9034d34

2 files changed

Lines changed: 0 additions & 13 deletions

File tree

src/MallPay/Vat.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44

55
use SlevomatCsobGateway\Currency;
66
use SlevomatCsobGateway\Encodable;
7-
use SlevomatCsobGateway\Validator;
87

98
class Vat implements Encodable
109
{
1110

1211
public function __construct(private int $amount, private Currency $currency, private int $vatRate)
1312
{
14-
Validator::checkNumberPositiveOrZero($amount);
1513
}
1614

1715
/**

tests/unit/MallPay/VatTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace SlevomatCsobGateway\MallPay;
44

5-
use InvalidArgumentException;
65
use PHPUnit\Framework\TestCase;
76
use SlevomatCsobGateway\Currency;
87

@@ -16,14 +15,4 @@ public function testEncode(): void
1615
self::assertSame(['amount' => 123, 'currency' => 'USD', 'vatRate' => 15], $vat->encode());
1716
}
1817

19-
public function testValidation(): void
20-
{
21-
try {
22-
new Vat(-123, Currency::USD, 15);
23-
self::fail();
24-
} catch (InvalidArgumentException $e) {
25-
self::assertSame('Value is negative.', $e->getMessage());
26-
}
27-
}
28-
2918
}

0 commit comments

Comments
 (0)