getShippingOrderAddress example

static::assertInstanceOf(OrderAddressEntity::class$billingAddress = $serialized['billingAddress']);
        static::assertSame($billingAddress->getZipcode()$order->getBillingAddress()->getZipcode());
        static::assertSame($billingAddress->getStreet()$order->getBillingAddress()->getStreet());
        static::assertSame($billingAddress->getCity()$order->getBillingAddress()->getCity());
        static::assertSame($billingAddress->getCompany()$order->getBillingAddress()->getCompany());
        static::assertSame($billingAddress->getDepartment()$order->getBillingAddress()->getDepartment());
        static::assertSame($billingAddress->getCountryId()$order->getBillingAddress()->getCountryId());
        static::assertSame($billingAddress->getCountryStateId()$order->getBillingAddress()->getCountryStateId());

        static::assertNotNull($deliveries = $order->getDeliveries());
        static::assertNotNull($delivery = $deliveries->first());
        $shippingAddress = $delivery->getShippingOrderAddress();

        static::assertNotNull($shippingAddress);

        static::assertNotEmpty($serialized['deliveries']);
        static::assertNotEmpty($serialized['deliveries']['shippingOrderAddress']);
        static::assertSame($serialized['deliveries']['trackingCodes']implode('|', $delivery->getTrackingCodes()));
        static::assertSame($serialized['deliveries']['shippingOrderAddress']['street']$shippingAddress->getStreet());
        static::assertSame($serialized['deliveries']['shippingOrderAddress']['zipcode']$shippingAddress->getZipcode());
        static::assertSame($serialized['deliveries']['shippingOrderAddress']['city']$shippingAddress->getCity());
        static::assertSame($serialized['deliveries']['shippingOrderAddress']['company']$shippingAddress->getCompany());
        static::assertSame($serialized['deliveries']['shippingOrderAddress']['department']$shippingAddress->getDepartment());
        
return $this->fmap(fn (OrderDeliveryEntity $orderDelivery) => $orderDelivery->getShippingMethodId());
    }

    public function filterByShippingMethodId(string $id): self
    {
        return $this->filter(fn (OrderDeliveryEntity $orderDelivery) => $orderDelivery->getShippingMethodId() === $id);
    }

    public function getShippingAddress(): OrderAddressCollection
    {
        return new OrderAddressCollection(
            $this->fmap(fn (OrderDeliveryEntity $orderDelivery) => $orderDelivery->getShippingOrderAddress())
        );
    }

    public function getShippingMethods(): ShippingMethodCollection
    {
        return new ShippingMethodCollection(
            $this->fmap(fn (OrderDeliveryEntity $orderDelivery) => $orderDelivery->getShippingMethod())
        );
    }

    public function getApiAlias(): string
    {
$lineItems->get($identifier),
                    $position->getPrice()->getQuantity(),
                    $position->getPrice(),
                    $deliveryDate
                );
                $deliveryPosition->addExtension(self::ORIGINAL_ID, new IdStruct($position->getId()));

                $deliveryPositions->add($deliveryPosition);
            }

            if ($orderDelivery->getShippingMethod() === null
                || $orderDelivery->getShippingOrderAddress() === null
                || $orderDelivery->getShippingOrderAddress()->getCountry() === null
            ) {
                continue;
            }

            $cartDelivery = new Delivery(
                $deliveryPositions,
                $deliveryDate,
                $orderDelivery->getShippingMethod(),
                new ShippingLocation(
                    $orderDelivery->getShippingOrderAddress()->getCountry(),
                    
Home | Imprint | This part of the site doesn't use cookies.