You are here

function commerce_avatax_get_config in Drupal Commerce Connector for AvaTax 7.4

Returns AvaTax request configurations.

2 calls to commerce_avatax_get_config()
commerce_avatax_get in ./commerce_avatax.module
Sends HTTP GET request to endpoint.
commerce_avatax_post in ./commerce_avatax.module
Sends HTTP POST request to endpoint.

File

./commerce_avatax.module, line 1157
Calculate Sales Tax using AvaTax service from Avalara, Inc.

Code

function commerce_avatax_get_config($account = '', $license = '', $base_url = '') {
  $use_mode = variable_get('commerce_avatax_use_mode');
  $product_version = variable_get('commerce_avatax_product_version');
  if (!$account) {
    $account = variable_get('commerce_avatax_' . $product_version . '_' . $use_mode . '_account');
  }
  if (!$license) {
    $license = variable_get('commerce_avatax_' . $product_version . '_' . $use_mode . '_license');
  }
  if (!$base_url) {
    if ($use_mode == COMMERCE_AVATAX_DEVELOPMENT_MODE) {
      $base_url = 'https://development.avalara.net/1.0';
    }
    elseif ($use_mode == COMMERCE_AVATAX_PRODUCTION_MODE) {
      $base_url = 'https://rest.avalara.net/1.0';
    }
  }
  return array(
    $use_mode,
    $product_version,
    $account,
    $license,
    $base_url,
  );
}