feat: delete cart when cannot order

This commit is contained in:
Maël Gangloff
2024-07-30 01:01:04 +02:00
parent 0a9d8ccfcf
commit 94bec57857

View File

@@ -59,7 +59,10 @@ readonly class OvhConnector implements ConnectorInterface
$offer['orderable'] === true && $offer['orderable'] === true &&
$offer['pricingMode'] === $pricingMode $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", [ $item = $conn->post("/order/cart/{$cartId}/domain", [
"domain" => $ldhName, "domain" => $ldhName,