mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: delete cart when cannot order
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user