fix: respect environment variable to toggle BPN debug mode

This commit is contained in:
Björn Fromme
2025-09-02 08:40:17 +02:00
parent 76aeb101bd
commit 1c2421fb7e
4 changed files with 10 additions and 6 deletions
+5 -4
View File
@@ -121,7 +121,7 @@ class ApiClient
'adressdaten' => $personalData->toPayload(),
];
return $this->sendRequest(static::TYPE_CUSTOMER_DATA, $data, $debug);
return $this->sendRequest(static::TYPE_CUSTOMER_DATA, $data);
}
/**
@@ -184,7 +184,7 @@ class ApiClient
/**
* @throws ApiClientException
*/
public function updateBooking(BookingData $formData, bool $debug = false): Notification|BookingUpdate
public function updateBooking(BookingData $formData): Notification|BookingUpdate
{
$payload = (new BookingDataProcessor())->createUpdateRequestPayload($formData);
@@ -196,7 +196,7 @@ class ApiClient
...$payload,
];
return $this->sendRequest(static::TYPE_BOOKING_UPDATE, $data, $debug);
return $this->sendRequest(static::TYPE_BOOKING_UPDATE, $data);
}
/**
@@ -282,9 +282,10 @@ class ApiClient
/**
* @throws ApiClientException
*/
private function sendRequest(string $type, array $data, bool $debug = false): mixed
private function sendRequest(string $type, array $data): mixed
{
$requestId = date(DATE_ATOM).uniqid();
$debug = $this->config['debug'];
$body = $this
->serializer
+3 -1
View File
@@ -146,6 +146,8 @@ class Booking
public function isEditable(): bool
{
return $this->travelDate > new \DateTimeImmutable() && false === in_array($this->status, ['S', 'U']);
$now = new \DateTimeImmutable();
return $this->travelDate > $now && false === in_array($this->status, ['S', 'U']);
}
}