Skip to content

Commit

Permalink
Merge branch 'release/0.5.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
code2prog committed Feb 6, 2024
2 parents 57d8aab + 2abd9f9 commit f6831ac
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.5.9",
"version": "0.5.10",
"name": "whatarmy/fedex-rest",
"description": "New FedEx Rest API wrapper",
"keywords": [
Expand Down
14 changes: 14 additions & 0 deletions src/FedexRest/Entity/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Address
public string $state_or_province;
public string $postal_code;
public string $country_code;
public bool $residential;

/**
* @param $street_lines
Expand Down Expand Up @@ -60,6 +61,16 @@ public function setCountryCode(string $country_code)
return $this;
}

/**
* @param bool $residential
* @return $this
*/
public function setResidential(bool $residential)
{
$this->residential = $residential;
return $this;
}

public function prepare(): array
{
$address = [];
Expand All @@ -78,6 +89,9 @@ public function prepare(): array
if (!empty($this->country_code)) {
$address['countryCode'] = $this->country_code;
}
if (!empty($this->residential)) {
$address['residential'] = $this->residential;
}

return $address;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function testValidateAddress()
->setStateOrProvince('TX')
->setPostalCode('75063-8659')
->setStreetLines('7372 PARKRIDGE BLVD', 'APT 286', '2903 sprank')
->setResidential(true)
)
->setAccessToken($this->auth->authorize()->access_token)
->request();
Expand Down

0 comments on commit f6831ac

Please sign in to comment.