22 lines
729 B
PHP
22 lines
729 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace Modules\Core\Checkout\Exceptions;
|
||
|
|
|
||
|
|
use RuntimeException;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Thrown by CheckoutService::selectShippingOption() when the given
|
||
|
|
* identifier doesn't resolve to a real, currently-available ShippingOption
|
||
|
|
* for the cart — Lunar's own ShippingManifest::getOption() just returns
|
||
|
|
* null, it has no matching exception type of its own to reuse here (same
|
||
|
|
* reasoning as Modules\Core\Cart\Exceptions\InvalidCouponException for
|
||
|
|
* Discounts::validateCoupon()).
|
||
|
|
*/
|
||
|
|
class InvalidShippingOptionException extends RuntimeException
|
||
|
|
{
|
||
|
|
public function __construct(public readonly string $identifier)
|
||
|
|
{
|
||
|
|
parent::__construct("The shipping option \"{$identifier}\" is not available for this cart.");
|
||
|
|
}
|
||
|
|
}
|