Feature: Adding Checkout Services and Events
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?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.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user