From 94bec57857fbd072b10c50abd963d50d419721cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gangloff?= Date: Tue, 30 Jul 2024 01:01:04 +0200 Subject: [PATCH] feat: delete cart when cannot order --- src/Config/Connector/OvhConnector.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Config/Connector/OvhConnector.php b/src/Config/Connector/OvhConnector.php index 5577ea4..be6896d 100644 --- a/src/Config/Connector/OvhConnector.php +++ b/src/Config/Connector/OvhConnector.php @@ -59,7 +59,10 @@ readonly class OvhConnector implements ConnectorInterface $offer['orderable'] === true && $offer['pricingMode'] === $pricingMode ); - if (empty($offer)) throw new Exception('Cannot buy this domain name'); + if (empty($offer)) { + $conn->delete("/order/cart/{$cartId}"); + throw new Exception('Cannot buy this domain name'); + } $item = $conn->post("/order/cart/{$cartId}/domain", [ "domain" => $ldhName,