feat: include bank account in booking data

This commit is contained in:
Björn Fromme
2025-03-27 11:41:30 +01:00
parent 3d9177f979
commit e4cea1e47d
4 changed files with 32 additions and 0 deletions
@@ -132,6 +132,15 @@ class BookingDataProcessor
],
];
if (null !== $bookingData->bankAccount) {
$payload['zahlung']['bankverbindung'] = [
'@kreditinstitut' => $bookingData->bankAccount->bankName,
'@iban' => $bookingData->bankAccount->iban,
'@bic' => $bookingData->bankAccount->bic,
'@kontoinhaber' => $bookingData->bankAccount->holder,
];
}
foreach ($bookingData->participants as $index => $participant) {
$payload['teilnehmerliste']['teilnehmer'][] = [
'@id' => $index,
+11
View File
@@ -0,0 +1,11 @@
<?php
namespace App\BusProNet\Model;
class BankAccount
{
public ?string $iban = null;
public ?string $bic = null;
public ?string $bankName = null;
public ?string $holder = null;
}
+1
View File
@@ -24,6 +24,7 @@ class Booking
public ?string $paymentId = null;
public ?string $paymentType = null;
public ?string $paymentLabel = null;
public ?BankAccount $bankAccount = null;
public array $participantsStatus = [];
public array $participants = [];
public array $transportationServices = [];
+11
View File
@@ -3,6 +3,7 @@
namespace App\BusProNet\XmlParser;
use App\BusProNet\Model\Address;
use App\BusProNet\Model\BankAccount;
use App\BusProNet\Model\Booking;
use App\BusProNet\Model\Communication;
use App\BusProNet\Model\PersonalData;
@@ -57,6 +58,16 @@ class BookingParser extends AbstractParser
$booking->paymentLabel = $paymentData->attr('bezeichnung');
$booking->paymentType = $paymentData->attr('art');
if (0 < $paymentData->children()->count()) {
$bankDataNode = $paymentData->children()->first();
$bankAccount = new BankAccount();
$bankAccount->iban = $bankDataNode->attr('iban');
$bankAccount->bic = $bankDataNode->attr('bic');
$bankAccount->bankName = $bankDataNode->attr('kreditinstitut');
$bankAccount->holder = $bankDataNode->attr('kontoinhaber');
$booking->bankAccount = $bankAccount;
}
$transportationData = $node->filterXPath('//beförderungen/beförderung');
if (0 < $transportationData->count()) {
$booking->transportationServices = $this