Ejemplo n.º 1
0
 /**
  * @param UuidInterface $cartId
  * @param string $shipmentRateExternalId
  * @param OrderAddressDTO $shippingAddressDTO
  */
 public function setExternalShipmentRate(UuidInterface $cartId, $shipmentRateExternalId, OrderAddressDTO $shippingAddressDTO)
 {
     $cart = $this->cartRepository->findOneById($cartId);
     $shipmentRate = $this->shipmentGateway->getShipmentRateByExternalId($shipmentRateExternalId);
     $cart->setShipmentRate($shipmentRate);
     $shippingAddress = OrderAddressDTOBuilder::createFromDTO($shippingAddressDTO);
     $cart->setShippingAddress($shippingAddress);
     $taxRate = $this->taxRateRepository->findByZip5AndState($shippingAddressDTO->zip5, $shippingAddressDTO->state);
     $cart->setTaxRate($taxRate);
     $this->cartRepository->update($cart);
 }