Moving default values to __construct, because otherwise they get overwritten
This commit is contained in:
parent
6d6853cbda
commit
2938be5a2d
@ -20,15 +20,14 @@ class Rate extends RateAdapter
|
||||
private $password;
|
||||
private $accountNumber;
|
||||
private $meterNumber;
|
||||
private $dropOffType = 'BUSINESS_SERVICE_CENTER';
|
||||
|
||||
public $approvedCodes = [
|
||||
'PRIORITY_OVERNIGHT',
|
||||
'FEDEX_2_DAY',
|
||||
'FEDEX_EXPRESS_SAVER',
|
||||
'FEDEX_GROUND',
|
||||
'GROUND_HOME_DELIVERY',
|
||||
];
|
||||
/**
|
||||
* Type of Drop off, default value "BUSINESS_SERVICE_CENTER" is defined in __construct if not specified.
|
||||
*/
|
||||
private $dropOffType;
|
||||
/**
|
||||
* Codes of appropriate shipping types. Default value is specified in __construct.
|
||||
*/
|
||||
public $approvedCodes;
|
||||
|
||||
private $shippingCodes = [
|
||||
'EUROPE_FIRST_INTERNATIONAL_PRIORITY' => 'Europe First International Priority',
|
||||
@ -62,8 +61,14 @@ class Rate extends RateAdapter
|
||||
$this->password = Arr::get($options, 'password');
|
||||
$this->accountNumber = Arr::get($options, 'accountNumber');
|
||||
$this->meterNumber = Arr::get($options, 'meterNumber');
|
||||
$this->approvedCodes = Arr::get($options, 'approvedCodes');
|
||||
$this->dropOffType = Arr::get($options, 'dropOffType');
|
||||
$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()));
|
||||
}
|
||||
|
@ -18,11 +18,10 @@ class Rate extends RateAdapter
|
||||
private $userId;
|
||||
private $password;
|
||||
private $shipperNumber;
|
||||
|
||||
public $approvedCodes = [
|
||||
'03',
|
||||
'12',
|
||||
];
|
||||
/**
|
||||
* Codes of appropriate shipping types. Default value is specified in __construct.
|
||||
*/
|
||||
public $approvedCodes;
|
||||
|
||||
private $shippingCodes = [
|
||||
'US' => [ // United States
|
||||
@ -90,7 +89,10 @@ class Rate extends RateAdapter
|
||||
$this->userId = Arr::get($options, 'userId');
|
||||
$this->password = Arr::get($options, 'password');
|
||||
$this->shipperNumber = Arr::get($options, 'shipperNumber');
|
||||
$this->approvedCodes = Arr::get($options, 'approvedCodes');
|
||||
$this->approvedCodes = Arr::get($options, 'approvedCodes',[
|
||||
'03',
|
||||
'12',
|
||||
]);
|
||||
|
||||
$this->setRequestAdapter(Arr::get($options, 'requestAdapter', new RateRequest\Post()));
|
||||
|
||||
|
@ -17,11 +17,10 @@ class Rate extends RateAdapter
|
||||
|
||||
private $username;
|
||||
private $password;
|
||||
|
||||
public $approvedCodes = [
|
||||
'1',
|
||||
'4',
|
||||
];
|
||||
/**
|
||||
* Codes of appropriate shipping types. Default value is specified in __construct.
|
||||
*/
|
||||
public $approvedCodes;
|
||||
|
||||
private $shipping_codes = [
|
||||
'domestic' => [
|
||||
@ -74,7 +73,10 @@ class Rate extends RateAdapter
|
||||
|
||||
$this->username = Arr::get($options, 'username');
|
||||
$this->password = Arr::get($options, 'password');
|
||||
$this->approvedCodes = Arr::get($options, 'approvedCodes');
|
||||
$this->approvedCodes = Arr::get($options, 'approvedCodes', [
|
||||
'1',
|
||||
'4',
|
||||
]);
|
||||
$this->setRequestAdapter(Arr::get($options, 'requestAdapter', new RateRequest\Get()));
|
||||
}
|
||||
protected function validate()
|
||||
|
Loading…
x
Reference in New Issue
Block a user