You are here

function commerce_fedex_update_7101 in Commerce FedEx 7

Migrate configuration for testing environments.

File

./commerce_fedex.install, line 51
Handles installation for Commerce FedEx module.

Code

function commerce_fedex_update_7101() {
  $variables_to_convert = array(
    'commerce_fedex_key',
    'commerce_fedex_password',
    'commerce_fedex_account_number',
    'commerce_fedex_meter_number',
  );

  // If we're in testing mode, put all of the values into the appropriate slots.
  if ('testing' == variable_get('commerce_fedex_request_mode', 'testing')) {
    foreach ($variables_to_convert as $variable) {
      variable_set($variable . '_testing', variable_get($variable));
      variable_set($variable, NULL);
    }
  }
}