We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Facing this issue in "Rate Class" API
$from = $request->from_zip; $to = $request->to_zip; $accessKey = env("UPS_ACCESS_KEY"); $userId = env("UPS_USER_ID"); $password = env("UPS_PASSWORD"); $rate = new Rate($accessKey,$userId,$password); // dd($rate); try { $shipment = new Shipment(); $shipperAddress = $shipment->getShipper()->getAddress(); $shipperAddress->setPostalCode($from); $address = new Address(); $address->setPostalCode($from); $shipFrom = new ShipFrom(); $shipFrom->setAddress($address); $shipment->setShipFrom($shipFrom); $shipTo = $shipment->getShipTo(); $shipTo->setCompanyName('Test Ship To'); $shipToAddress = $shipTo->getAddress(); $shipToAddress->setPostalCode($to); $package = new Package(); $package->getPackagingType()->setCode(PackagingType::PT_PACKAGE); $package->getPackageWeight()->setWeight(1); // if you need this (depends of the shipper country) $weightUnit = new UnitOfMeasurement; $weightUnit->setCode(UnitOfMeasurement::UOM_KGS); $package->getPackageWeight()->setUnitOfMeasurement($weightUnit); $dimensions = new Dimensions(); $dimensions->setHeight(5); $dimensions->setWidth(5); $dimensions->setLength(5); $unit = new UnitOfMeasurement; $unit->setCode(UnitOfMeasurement::UOM_IN); $dimensions->setUnitOfMeasurement($unit); $package->setDimensions($dimensions); $shipment->addPackage($package); var_dump($rate->getRate($shipment)); } catch (Exception $e) { var_dump($e); }
The text was updated successfully, but these errors were encountered:
Change UOM_KGS to UOM_LBS, that should fix it
Sorry, something went wrong.
No branches or pull requests
Facing this issue in "Rate Class" API
The text was updated successfully, but these errors were encountered: