You are here

function _commerce_fedex_soap_authentication in Commerce FedEx 7

Internal function to build authentication array for SOAP request.

Return value

array An array including all of the authentication values for FedEx.

1 call to _commerce_fedex_soap_authentication()
commerce_fedex_submit_soap_request in includes/commerce_fedex_soap_client.inc
Submits a SOAP request to FedEx and returns the response object.

File

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

Code

function _commerce_fedex_soap_authentication() {
  $authentication = array();
  $mode = '';
  $request_mode = variable_get('commerce_fedex_request_mode', 'testing');
  if ($request_mode != 'production') {
    $mode = '_' . $request_mode;
  }

  // Add the FedEx web services key and password credentials.
  $authentication['WebAuthenticationDetail'] = array(
    'UserCredential' => array(
      'Key' => variable_get('commerce_fedex_key' . $mode, NULL),
      'Password' => variable_get('commerce_fedex_password' . $mode, NULL),
    ),
  );

  // Add the FedEx web services account and meter numbers.
  $authentication['ClientDetail'] = array(
    'AccountNumber' => variable_get('commerce_fedex_account_number' . $mode, NULL),
    'MeterNumber' => variable_get('commerce_fedex_meter_number' . $mode, NULL),
  );
  return $authentication;
}