diff --git a/src/Handlers/AbstractPaymentMethodHandler.php b/src/Handlers/AbstractPaymentMethodHandler.php index 363aa71f..45b6b971 100644 --- a/src/Handlers/AbstractPaymentMethodHandler.php +++ b/src/Handlers/AbstractPaymentMethodHandler.php @@ -292,13 +292,16 @@ public function pay( */ $stateData = $requestStateData ?? $storedStateData ?? []; + $billieData = []; $companyName = $dataBag->get('companyName'); $registrationNumber = $dataBag->get('registrationNumber'); - $billieData = [ - 'companyName' => $companyName, - 'registrationNumber' => $registrationNumber, - ]; + if ($companyName && $registrationNumber) { + $billieData = [ + 'companyName' => $companyName, + 'registrationNumber' => $registrationNumber, + ]; + } /* * If there are more than one stateData and /payments calls have been completed, @@ -773,7 +776,10 @@ private function getPaymentRequest( $billieData = [] ) { $transactionId = $transaction->getOrderTransaction()->getId(); - $stateData['billieData'] = $billieData; + if ($billieData !== []) { + $stateData['billieData'] = $billieData; + } + try { $request = $this->preparePaymentsRequest( $salesChannelContext,