Commit 5e98c275 authored by jenlampton's avatar jenlampton

Update that variable name that's been bugging me.

parent fba380c4
......@@ -10,7 +10,7 @@
function authorizenetwebform_admin_settings() {
$form = array();
$form['authorizenetwebform_url'] = array(
$form['authorizenetwebform_mode'] = array(
'#type' => 'radios',
'#title' => t('Transaction mode'),
'#description' => t('Unless you are using a sandbox account, this should be set to Live.'),
......@@ -18,11 +18,11 @@ function authorizenetwebform_admin_settings() {
'main' => t('Live account'),
'test' => t('Test (or Sandbox) account'),
),
'#default_value' => variable_get('authorizenetwebform_url', 'main'),
'#default_value' => variable_get('authorizenetwebform_mode', 'main'),
);
// Add description text for URL choices.
$form['authorizenetwebform_url']['test']['#description'] = t('Posts to https://test.authorize.net/gateway/transact.dll');
$form['authorizenetwebform_url']['main']['#description'] = t('Posts to https://secure.authorize.net/gateway/transact.dll');
$form['authorizenetwebform_mode']['test']['#description'] = t('Posts to https://test.authorize.net/gateway/transact.dll');
$form['authorizenetwebform_mode']['main']['#description'] = t('Posts to https://secure.authorize.net/gateway/transact.dll');
$form['login'] = array(
'#type' => 'fieldset',
......
<?php
/**
* @file
* Authorize.Net Webform Module Installation File
......@@ -41,9 +40,18 @@ function authorizenetwebform_schema() {
* Implements hook_uninstall().
*/
function authorizenetwebform_uninstall() {
variable_del("authorizenetwebform_login");
variable_del("authorizenetwebform_transaction");
variable_del("authorizenetwebform_custom_fields");
variable_del("authorizenetwebform_url");
variable_del('authorizenetwebform_login');
variable_del('authorizenetwebform_transaction');
variable_del('authorizenetwebform_custom_fields');
variable_del('authorizenetwebform_url');
variable_del('authorizenetwebform_client_key');
}
/**
* Implements hook_update_N. Changes a variable name.
*/
function authorizenetwebform_update_7000() {
$mode = variable_get('authorizenetwebform_url', 'main');
variable_set('authorizenetwebform_mode', $mode);
variable_delete('authorizenetwebform_url');
}
......@@ -156,7 +156,7 @@ function authorizenetwebform_form_webform_client_form_alter(&$form, &$form_state
// Add accept.js.
$js_url = 'https://js.authorize.net/v1/Accept.js';
if (variable_get('authorizenetwebform_url', 'main') == 'test') {
if (variable_get('authorizenetwebform_mode', 'main') == 'test') {
$js_url = 'https://jstest.authorize.net/v1/Accept.js';
}
......@@ -377,7 +377,7 @@ function authorizenetwebform_webform_client_form_submit($form, &$form_state) {
// Set the post URL.
$post_url = 'https://api.authorize.net/xml/v1/request.api';
if (variable_get('authorizenetwebform_url', 'main') == 'test') {
if (variable_get('authorizenetwebform_mode', 'main') == 'test') {
$post_url = 'https://apitest.authorize.net/xml/v1/request.api';
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment