You are here

public static function FedExAddressResolver::addressResolveHK in Commerce FedEx 8

Resolve Addresses in Hong Kong.

Parameters

\Drupal\address\AddressInterface $address: The address to resolve.

Return value

\NicholasCreativeMedia\FedExPHP\Structs\Party A Fedex Compatible party.

File

src/FedExAddressResolver.php, line 60

Class

FedExAddressResolver
Allow Country level modifications when converting Drupal addresses to fedex.

Namespace

Drupal\commerce_fedex

Code

public static function addressResolveHK(AddressInterface $address) {
  $party = new Party();
  $party
    ->setAddress(new Address(array_filter([
    $address
      ->getAddressLine1(),
    $address
      ->getAddressLine2(),
  ]), $address
    ->getAdministrativeArea() . ', ' . $address
    ->getLocality(), NULL, $address
    ->getPostalCode(), NULL, $address
    ->getCountryCode(), NULL, FALSE));
  return $party;
}