Open mgiritli opened 4 years ago
I'm getting an invalid response: 400 error as well when creating a new order.
Have you filled your e-mail address and domain data in the example code? That has caused problems in the past. Then it might be a duplicate of https://github.com/yourivw/LEClient/issues/67.
@yourivw Having the same problem.
LEClient\Exceptions\LEConnectorException
Invalid response: 400
ini_set('max_execution_time', 120);
$email = array($user->email);
$basename = $this->getTlDomain($request->custom_url);
$domains = array($request->custom_url);
$client = new LEClient($email, LEClient::LE_STAGING);
$email
, $basename
and $domains
all output correct data. Although I'm not sure why the email is supposed to be an array. But anyway, that's how far I get. Now, I'm not sure if this is because of my localhost environment? Should still work, right?
[2020-08-23 07:27:29] local.ERROR: Invalid response: 400 {"userId":1,"exception":"[object] (LEClient\\Exceptions\\LEConnectorException(code: 21): Invalid response: 400 at /Users/-/Code/-/vendor/yourivw/leclient/src/Exceptions/LEConnectorException.php:69)
[stacktrace]
#0 /Users/-/Code/-/vendor/yourivw/leclient/src/LEConnector.php(167): LEClient\\Exceptions\\LEConnectorException::InvalidResponseException(Array)
#1 /Users/-/Code/-/vendor/yourivw/leclient/src/LEConnector.php(195): LEClient\\LEConnector->request('POST', 'https://acme-st...', '{\"protected\":\"e...')
#2 /Users/-/Code/-/vendor/yourivw/leclient/src/LEAccount.php(116): LEClient\\LEConnector->post('https://acme-st...', '{\"protected\":\"e...')
#3 /Users/-/Code/-/vendor/yourivw/leclient/src/LEAccount.php(82): LEClient\\LEAccount->getLEAccount()
#4 /Users/-/Code/-/vendor/yourivw/leclient/src/LEClient.php(156): LEClient\\LEAccount->__construct(Object(LEClient\\LEConnector), 0, Array, Array)
#5 /Users/-/Code/-/app/Http/Controllers/BaseController.php(284): LEClient\\LEClient->__construct(Array, 'https://acme-st...')
#6 [internal function]: App\\Http\\Controllers\\BaseController->updateDomain(Object(Illuminate\\Http\\Request))
#7 /Users/-/Code/-/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#8 /Users/-/Code/-/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('updateDomain', Array)
In my case, the error seems to be caused by the line $client = new LEClient($email, LEClient::LE_STAGING);
.
For me it was cause I was using the same Account key from Staging on Production. I had to delete the account key to recreate it.
I'm trying to use this library but could not get too far. The very simple line:
$client = new LEClient($email);
causes HTTP 400 error. Is it possible something have changed in the LE API recently that needs to be incorporated in LEClient?
Using php 7.4.6 & LEclient 1.2.2