diff --git a/src/BusProNet/DataProcessor/BookingDataProcessor.php b/src/BusProNet/DataProcessor/BookingDataProcessor.php index cb71f94..f5fcce7 100644 --- a/src/BusProNet/DataProcessor/BookingDataProcessor.php +++ b/src/BusProNet/DataProcessor/BookingDataProcessor.php @@ -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, diff --git a/src/BusProNet/Model/BankAccount.php b/src/BusProNet/Model/BankAccount.php new file mode 100644 index 0000000..92ff70e --- /dev/null +++ b/src/BusProNet/Model/BankAccount.php @@ -0,0 +1,11 @@ +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