Skip to content

Commit

Permalink
Fix voucher token max usage limit (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
dolmit-tanel-paaro authored Mar 29, 2024
1 parent 0367391 commit 2ace7ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/VoucherService/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static function isUsedToken(string $code, int $maxUsages = 1): bool
public function check(int $maxUsages = null, bool $isCheckout = false): bool
{
if (isset($maxUsages)) {
if ($this->getUsages() + Reservation::getReservationCount($this->getToken()) - (int)$isCheckout <= $maxUsages) {
if ($this->getUsages() + Reservation::getReservationCount($this->getToken()) - (int)$isCheckout < $maxUsages) {
return true;
}

Expand Down

0 comments on commit 2ace7ec

Please sign in to comment.