feat: include bank account in booking data
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user