Surface connected domains in Ladill Domains' My Domains
Deploy Ladill Merchant / deploy (push) Successful in 1m36s
Deploy Ladill Merchant / deploy (push) Successful in 1m36s
Push the customer's connected domain to the central connected-domains registry so it appears under My Domains (with Transfer in if not registered with Ladill). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
55a2cc71a7
commit
24d47ac04e
@@ -49,4 +49,37 @@ class DomainsSslClient
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/** Register/update this domain in Ladill Domains' connected-domains registry (best-effort). */
|
||||
public function registerConnected(string $host, string $ownerPublicId, ?string $label = null, ?string $linkUrl = null): void
|
||||
{
|
||||
if (! $this->configured() || $ownerPublicId === '') {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Http::withToken((string) config('customdomain.ssl_api_key'))->acceptJson()->timeout(10)
|
||||
->post(config('customdomain.ssl_api_url').'/connected-domains', array_filter([
|
||||
'host' => $host,
|
||||
'owner_public_id' => $ownerPublicId,
|
||||
'label' => $label,
|
||||
'link_url' => $linkUrl,
|
||||
]));
|
||||
} catch (\Throwable $e) {
|
||||
Log::info('DomainsSslClient: connected register skipped', ['host' => $host, 'error' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
/** Remove this domain from the connected-domains registry (best-effort). */
|
||||
public function removeConnected(string $host): void
|
||||
{
|
||||
if (! $this->configured()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Http::withToken((string) config('customdomain.ssl_api_key'))->acceptJson()->timeout(10)
|
||||
->delete(config('customdomain.ssl_api_url').'/connected-domains/'.urlencode($host));
|
||||
} catch (\Throwable $e) {
|
||||
Log::info('DomainsSslClient: connected remove skipped', ['host' => $host, 'error' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user