You are here

function _commerce_fedex_get_shipper in Commerce FedEx 7

Internal function to build shipper (ship from) array.

Return value

array An array that represents the ship from address.

1 call to _commerce_fedex_get_shipper()
commerce_fedex_create_rate_request in includes/commerce_fedex_soap_client.inc
Function to create FedEx rate request array.

File

includes/commerce_fedex_soap_client.inc, line 219
Handles the SOAP request/response to FedEx Web Services servers.

Code

function _commerce_fedex_get_shipper() {

  // We default the shipper_name to company_name.
  $company_name = variable_get('commerce_fedex_company_name');
  $shipper_name = variable_get('commerce_fedex_shipper_name', $company_name);
  $shipper = array(
    'Contact' => array(
      'PersonName' => $shipper_name,
      'CompanyName' => $company_name,
    ),
    'Address' => array(
      'StreetLines' => array(
        variable_get('commerce_fedex_address_line_1'),
      ),
      'City' => variable_get('commerce_fedex_city'),
      'StateOrProvinceCode' => variable_get('commerce_fedex_state'),
      'PostalCode' => variable_get('commerce_fedex_postal_code'),
      'CountryCode' => variable_get('commerce_fedex_country_code'),
    ),
  );
  return $shipper;
}