protected function validatePackage(Package $package, RateAdapter $adapter)
 {
     $shipment = new Shipment();
     $shipment->setFromStateProvinceCode('CA')->setFromPostalCode('90401')->setFromCountryCode('US')->setFromIsResidential(true)->setToPostalCode('78703')->setToCountryCode('US')->setToIsResidential(true)->addPackage($package);
     $adapter->setShipment($shipment);
     $adapter->getRates();
 }
示例#2
0
文件: Rate.php 项目: dlashua/shipping
 public function __construct($options = [])
 {
     parent::__construct($options);
     $this->username = Arr::get($options, 'username');
     $this->password = Arr::get($options, 'password');
     $this->approvedCodes = Arr::get($options, 'approvedCodes', ['1', '4']);
     $this->setRequestAdapter(Arr::get($options, 'requestAdapter', new RateRequest\Get()));
 }
示例#3
0
文件: Rate.php 项目: dlashua/shipping
 public function __construct($options = [])
 {
     parent::__construct($options);
     $this->accessKey = Arr::get($options, 'accessKey');
     $this->userId = Arr::get($options, 'userId');
     $this->password = Arr::get($options, 'password');
     $this->shipperNumber = Arr::get($options, 'shipperNumber');
     $this->approvedCodes = Arr::get($options, 'approvedCodes', ['03', '12']);
     $this->setRequestAdapter(Arr::get($options, 'requestAdapter', new RateRequest\Post()));
 }
示例#4
0
文件: Rate.php 项目: dlashua/shipping
 public function __construct($options = [])
 {
     parent::__construct($options);
     $this->key = Arr::get($options, 'key');
     $this->password = Arr::get($options, 'password');
     $this->accountNumber = Arr::get($options, 'accountNumber');
     $this->meterNumber = Arr::get($options, 'meterNumber');
     $this->approvedCodes = Arr::get($options, 'approvedCodes', ['PRIORITY_OVERNIGHT', 'FEDEX_2_DAY', 'FEDEX_EXPRESS_SAVER', 'FEDEX_GROUND', 'GROUND_HOME_DELIVERY']);
     $this->dropOffType = Arr::get($options, 'dropOffType', 'BUSINESS_SERVICE_CENTER');
     $this->setRequestAdapter(Arr::get($options, 'requestAdapter', new RateRequest\Post()));
 }