Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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()));
 }
Exemplo n.º 3
0
 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()));
 }
Exemplo n.º 4
0
 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()));
 }