Based upon TestOrderpersister, this is how I create new orders:
$order = new OrderEntity();
$order->setUniqueIdentifier(md5($someUniqueData));
$persister = new OrderPersister($this->orderRepository, $this->orderConverter);
$token = Uuid::randomHex();
$salesChannelContext = $this->salesChannelContextFactory->create($token, Defaults::SALES_CHANNEL);
$persister->persist($cart, $salesChannelContext);
How can I inject the customer data (name, address…) into the order? It has a SetOrderCustomer method, but no SetCustomer() method. The aforementioned test file depends on injecting the customer data into the SaleschanenlContext, but it does so using a test-specific mock method.