mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: Exception in dry-run with Gandi Provider
This commit is contained in:
@@ -118,6 +118,7 @@ export function ConnectorForm({form, onCreate}: { form: FormInstance, onCreate:
|
|||||||
label={t`API Terms of Service`}
|
label={t`API Terms of Service`}
|
||||||
name={['authData', 'acceptConditions']}
|
name={['authData', 'acceptConditions']}
|
||||||
rules={[{required: true, message: t`Required`}]}
|
rules={[{required: true, message: t`Required`}]}
|
||||||
|
style={{marginTop: '3em'}}
|
||||||
>
|
>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
required={true}>
|
required={true}>
|
||||||
|
|||||||
@@ -82,7 +82,8 @@ readonly class GandiConnector implements ConnectorInterface
|
|||||||
|
|
||||||
$res = $this->client->request('POST', '/domain/domains', $httpOptions->toArray());
|
$res = $this->client->request('POST', '/domain/domains', $httpOptions->toArray());
|
||||||
|
|
||||||
if (Response::HTTP_ACCEPTED !== $res->getStatusCode()) {
|
if ((!$dryRun && Response::HTTP_ACCEPTED !== $res->getStatusCode())
|
||||||
|
|| ($dryRun && Response::HTTP_OK !== $res->getStatusCode())) {
|
||||||
throw new \Exception($res->toArray()['message']);
|
throw new \Exception($res->toArray()['message']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,15 +63,15 @@ final readonly class ProcessDomainTriggerHandler
|
|||||||
$isDebug = $this->kernel->isDebug();
|
$isDebug = $this->kernel->isDebug();
|
||||||
|
|
||||||
if (ConnectorProvider::OVH === $connector->getProvider()) {
|
if (ConnectorProvider::OVH === $connector->getProvider()) {
|
||||||
$ovh = new OvhConnector($connector->getAuthData());
|
$provider = new OvhConnector($connector->getAuthData());
|
||||||
$ovh->orderDomain($domain, $isDebug);
|
|
||||||
} elseif (ConnectorProvider::GANDI === $connector->getProvider()) {
|
} elseif (ConnectorProvider::GANDI === $connector->getProvider()) {
|
||||||
$gandi = new GandiConnector($connector->getAuthData(), $this->client);
|
$provider = new GandiConnector($connector->getAuthData(), $this->client);
|
||||||
$gandi->orderDomain($domain, $isDebug);
|
|
||||||
} else {
|
} else {
|
||||||
throw new \Exception('Unknown provider');
|
throw new \Exception('Unknown provider');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$provider->orderDomain($domain, $isDebug);
|
||||||
|
|
||||||
$this->sendEmailDomainOrdered($domain, $connector, $watchList->getUser());
|
$this->sendEmailDomainOrdered($domain, $connector, $watchList->getUser());
|
||||||
} catch (\Throwable) {
|
} catch (\Throwable) {
|
||||||
$this->logger->warning('Unable to complete purchase. An error message is sent to user {username}.', [
|
$this->logger->warning('Unable to complete purchase. An error message is sent to user {username}.', [
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ msgstr ""
|
|||||||
#: assets/components/tracking/ConnectorForm.tsx:89
|
#: assets/components/tracking/ConnectorForm.tsx:89
|
||||||
#: assets/components/tracking/ConnectorForm.tsx:100
|
#: assets/components/tracking/ConnectorForm.tsx:100
|
||||||
#: assets/components/tracking/ConnectorForm.tsx:120
|
#: assets/components/tracking/ConnectorForm.tsx:120
|
||||||
#: assets/components/tracking/ConnectorForm.tsx:133
|
#: assets/components/tracking/ConnectorForm.tsx:134
|
||||||
#: assets/components/tracking/ConnectorForm.tsx:142
|
#: assets/components/tracking/ConnectorForm.tsx:143
|
||||||
#: assets/components/tracking/WatchlistForm.tsx:103
|
#: assets/components/tracking/WatchlistForm.tsx:103
|
||||||
msgid "Required"
|
msgid "Required"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -186,12 +186,12 @@ msgid ""
|
|||||||
"that may be available soon."
|
"that may be available soon."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: assets/components/tracking/ConnectorForm.tsx:153
|
#: assets/components/tracking/ConnectorForm.tsx:154
|
||||||
#: assets/components/tracking/WatchlistForm.tsx:186
|
#: assets/components/tracking/WatchlistForm.tsx:186
|
||||||
msgid "Create"
|
msgid "Create"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: assets/components/tracking/ConnectorForm.tsx:156
|
#: assets/components/tracking/ConnectorForm.tsx:157
|
||||||
#: assets/components/tracking/WatchlistForm.tsx:189
|
#: assets/components/tracking/WatchlistForm.tsx:189
|
||||||
msgid "Reset"
|
msgid "Reset"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -232,27 +232,27 @@ msgstr ""
|
|||||||
msgid "API Terms of Service"
|
msgid "API Terms of Service"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: assets/components/tracking/ConnectorForm.tsx:125
|
#: assets/components/tracking/ConnectorForm.tsx:126
|
||||||
msgid ""
|
msgid ""
|
||||||
"I certify that I have read and accepted the conditions of use of the "
|
"I certify that I have read and accepted the conditions of use of the "
|
||||||
"Provider API, accessible from this hyperlink"
|
"Provider API, accessible from this hyperlink"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: assets/components/tracking/ConnectorForm.tsx:131
|
#: assets/components/tracking/ConnectorForm.tsx:132
|
||||||
msgid "Legal age"
|
msgid "Legal age"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: assets/components/tracking/ConnectorForm.tsx:136
|
#: assets/components/tracking/ConnectorForm.tsx:137
|
||||||
msgid ""
|
msgid ""
|
||||||
"I certify on my honor that I am of the minimum age required to consent to "
|
"I certify on my honor that I am of the minimum age required to consent to "
|
||||||
"these conditions"
|
"these conditions"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: assets/components/tracking/ConnectorForm.tsx:140
|
#: assets/components/tracking/ConnectorForm.tsx:141
|
||||||
msgid "Withdrawal period"
|
msgid "Withdrawal period"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: assets/components/tracking/ConnectorForm.tsx:145
|
#: assets/components/tracking/ConnectorForm.tsx:146
|
||||||
msgid ""
|
msgid ""
|
||||||
"I expressly waive my right of withdrawal regarding the purchase of domain "
|
"I expressly waive my right of withdrawal regarding the purchase of domain "
|
||||||
"names via the Provider's API"
|
"names via the Provider's API"
|
||||||
|
|||||||
Reference in New Issue
Block a user