Files
core/src/Cart/Exceptions/InvalidCouponException.php
T

20 lines
550 B
PHP

<?php
namespace Modules\Core\Cart\Exceptions;
use RuntimeException;
/**
* Thrown by CartService::applyCoupon() when the given code doesn't match any
* currently-active, non-exhausted Discount — Lunar's own
* Discounts::validateCoupon() only returns a bool, it has no matching
* exception type of its own to reuse here.
*/
class InvalidCouponException extends RuntimeException
{
public function __construct(public readonly string $couponCode)
{
parent::__construct("The coupon code \"{$couponCode}\" is not valid.");
}
}