You are here

function commerce_ups_api_endpoint in Commerce UPS 7.2

Defines the available endpoints for the UPS XML API.

1 call to commerce_ups_api_endpoint()
commerce_ups_api_request in includes/commerce_ups.xml.inc
Submits an API request to the Progistics XML Processor.

File

./commerce_ups.module, line 319
Handles main functionality for Commerce UPS module.

Code

function commerce_ups_api_endpoint($method) {
  $endpoints = array(
    'Rate' => 'https://onlinetools.ups.com/ups.app/xml/Rate',
    'ShipConfirm' => 'https://onlinetools.ups.com/ups.app/xml/ShipConfirm',
    'ShipAccept' => 'https://onlinetools.ups.com/ups.app/xml/ShipAccept',
    // Test URLs
    'RateTest' => 'https://wwwcie.ups.com/ups.app/xml/Rate',
    'ShipConfirmTest' => 'https://wwwcie.ups.com/ups.app/xml/ShipConfirm',
    'ShipAcceptTest' => 'https://wwwcie.ups.com/ups.app/xml/ShipAccept',
  );

  // Allow other modules to alter the API endpoints.
  drupal_alter('commerce_ups_api_endpoint', $endpoints, $method);
  if (!empty($endpoints[$method])) {
    return $endpoints[$method];
  }
  return FALSE;
}