GO: Improve error output, add info to settings

This commit is contained in:
Andreas Palm 2025-01-10 15:13:49 +01:00
parent afab111c75
commit 16bf511783
2 changed files with 7 additions and 3 deletions

View File

@ -16,7 +16,7 @@ class GoApi {
protected string $baseUrl; protected string $baseUrl;
public function __construct(protected string $username, protected string $password, bool $testMode) { public function __construct(protected string $username, protected string $password, bool $testMode = true) {
if ($testMode) if ($testMode)
$this->baseUrl = self::BASE_URL_TEST; $this->baseUrl = self::BASE_URL_TEST;
else else
@ -49,6 +49,10 @@ class GoApi {
$ret->barcodes = array_map(function ($item) { return $item->barcode; }, $response->package); $ret->barcodes = array_map(function ($item) { return $item->barcode; }, $response->package);
return $ret; return $ret;
} }
if (isset($response->message))
return $response->message; return $response->message;
if (isset($response->Message))
return $response->Message;
return print_r($response, TRUE);
} }
} }

View File

@ -55,7 +55,7 @@ class Versandart_go extends Versanddienstleister
'consignorHouseNumber' => ['typ' => 'text', 'bezeichnung' => 'Absender Hausnummer:'], 'consignorHouseNumber' => ['typ' => 'text', 'bezeichnung' => 'Absender Hausnummer:'],
'consignorZipCode' => ['typ' => 'text', 'bezeichnung' => 'Absender PLZ:'], 'consignorZipCode' => ['typ' => 'text', 'bezeichnung' => 'Absender PLZ:'],
'consignorCity' => ['typ' => 'text', 'bezeichnung' => 'Absender Stadt:'], 'consignorCity' => ['typ' => 'text', 'bezeichnung' => 'Absender Stadt:'],
'consignorCountry' => ['typ' => 'text', 'bezeichnung' => 'Absender Land:'], 'consignorCountry' => ['typ' => 'text', 'bezeichnung' => 'Absender Land:', 'info' => '2-Letter-Code (z.B. \'DE\')'],
'consignorPhoneNumber' => ['typ' => 'text', 'bezeichnung' => 'Absender Telefon:'], 'consignorPhoneNumber' => ['typ' => 'text', 'bezeichnung' => 'Absender Telefon:'],
'consignorRemarks' => ['typ' => 'text', 'bezeichnung' => 'Absender Bemerkungen:'], 'consignorRemarks' => ['typ' => 'text', 'bezeichnung' => 'Absender Bemerkungen:'],
'consignorEmail' => ['typ' => 'text', 'bezeichnung' => 'Absender Email:'], 'consignorEmail' => ['typ' => 'text', 'bezeichnung' => 'Absender Email:'],