예제 #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);
 }
예제 #2
0
 /**
  * @param string $zip5
  * @param string $state
  * @return TaxRate|null
  */
 public function findByZip5AndState($zip5 = null, $state = null)
 {
     return $this->taxRateRepository->findByZip5AndState($zip5, $state);
 }
 public function testFindByZip5AndStateMissing()
 {
     $taxRate = $this->taxRateRepository->findByZip5AndState('11111');
     $this->assertSame(null, $taxRate);
 }