ALTER TABLE `hosting_order` ADD `fg_call_info` LONGTEXT NOT NULL ;
ALTER TABLE `session_history` ADD `fg_call_info` LONGTEXT NOT NULL ;

CREATE TABLE `autopilot_fraudgate` (
  `fg_variable` varchar(32) NOT NULL default '',
  `fg_name` varchar(50) NOT NULL default '',
  `fg_type` varchar(128) NOT NULL default '',
  `fg_value` varchar(255) default NULL,
  `fg_description` text,
  `fg_function` varchar(255) NOT NULL default ''
) TYPE=MyISAM;

INSERT INTO `autopilot_fraudgate` VALUES ('activate', 'Activate Module?', 'FUNCTION', '1', 'Do you wish to activate your FraudGate module?', 'radioChoices("activate", array("Yes" => 1, "No" => 0),0,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_LOGIN', 'Username', 'input type="text" name="FG_LOGIN" size=20 maxlength=20', 'username', 'Your FraudGate account username.', '');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_PASSWORD', 'Password', 'input type="password" name="FG_PASSWORD" size=20 maxlength=20', 'password', 'Your FraudGate account password.', '');
INSERT INTO `autopilot_fraudgate` VALUES ('stepCall', 'Pre-authorize Transactions?', 'FUNCTION', '0', 'Select ''Yes'' if you would like to perform the verification <i>before</i> the credit card is authorized.  Select ''No'' if you would like to perform the verification <i>after</i> the credit card is authorized.', 'radioChoices("stepCall", array("Yes" => 1, "No" => 0),1,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_MENU_ID', 'Menu ID', 'input type="text" name="FG_MENU_ID" size=4 maxlength=4', '11', 'The menu ID that should be used to place the phone call.', '');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_MAX_RETRY', 'Max Retries', 'FUNCTION', '0', 'Enter how many times you wish to retry the call if it fails at first.', 'selectBoxes2(FG_MAX_RETRY, 5,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_TEST_REQUEST', 'Test Request?', 'FUNCTION', 'FALSE', 'Set this to ''True'' if you want to test the gateway and make sure the integration is functioning properly. FraudGate will only post back in the case of an error. Otherwise, it will return as a successful test and not be inserted into your call history. The call is not actually made.', 'radioChoices("FG_TEST_REQUEST", array("True" => "TRUE", "False" => "FALSE"),0,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_MATCHER', 'Matcher', 'FUNCTION', 'TRUE', 'Set this to ''True'' if you''d like a phone call placed regardless of the fraud score.', 'radioChoices("FG_MATCHER", array("True" => "TRUE", "False" => "FALSE"),0,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_POST_BACK_URL', 'Postback Method', 'input type="text" name="FG_POST_BACK_URL" size=40', 'http://yoursite.com/receiveCall.php', 'Be sure to change the url to the path to your installed directory and website. The HTTP method you would like the gateway to passback data in. POST is highly recommended.', '');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_POST_BACK_METHOD', 'PostBack Method', 'FUNCTION', 'POST', 'The method your script uses. The default uses POST method.', 'radioChoices("FG_POST_BACK_METHOD", array("POST" => "POST", "GET" => "GET"),0,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_HOUR', 'Hour Offset', 'FUNCTION', '0', 'The number of hours the gateway should delay placing the call.', 'selectBoxes2(FG_HOUR, 24,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_MIN', 'Minute Offset', 'FUNCTION', '0', 'The number of minutes the gateway should delay placing the call.', 'selectBoxes2(FG_MIN, 59,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_INPUT_1', 'Input 1', 'FUNCTION', 'order number', 'The first input that you would like to collect from the caller.<br>Random numbers will be used for pre-authorization verifications. The order number should be used for post-authorizations.', 'selectBoxes(FG_INPUT_1,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_INPUT_2', 'Input 2', 'FUNCTION', 'no input required', 'The second input that you would like to collect from the caller.<br>Random numbers will be used for pre-authorization verifications. The order number should be used for post-authorizations.', 'selectBoxes(FG_INPUT_2,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_INPUT_3', 'Input 3', 'FUNCTION', 'no input required', 'The third input that you would like to collect from the caller.<br>Random numbers will be used for pre-authorization verifications. The order number should be used for post-authorizations.', 'selectBoxes(FG_INPUT_3,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_INPUT_4', 'Input 4', 'FUNCTION', 'no input required', 'The fourth input that you would like to collect from the caller.<br>Random numbers will be used for pre-authorization verifications. The order number should be used for post-authorizations.', 'selectBoxes(FG_INPUT_4,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_INPUT_5', 'Input 5', 'FUNCTION', 'no input required', 'The fifth input that you would like to collect from the caller.<br>Random numbers will be used for pre-authorization verifications. The order number should be used for post-authorizations.', 'selectBoxes(FG_INPUT_5,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_INPUT_6', 'Input 6', 'FUNCTION', 'no input required', 'The sixth input that you would like to collect from the caller.<br>Random numbers will be used for pre-authorization verifications. The order number should be used for post-authorizations.', 'selectBoxes(FG_INPUT_6,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_INPUT_7', 'Input 7', 'FUNCTION', 'no input required', 'The seventh input that you would like to collect from the caller.<br>Random numbers will be used for pre-authorization verifications. The order number should be used for post-authorizations.', 'selectBoxes(FG_INPUT_7,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_INPUT_8', 'Input 8', 'FUNCTION', 'no input required', 'The eighth input that you would like to collect from the caller.<br>Random numbers will be used for pre-authorization verifications. The order number should be used for post-authorizations.', 'selectBoxes(FG_INPUT_8,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_INPUT_9', 'Input 9', 'FUNCTION', 'no input required', 'The ninth input that you would like to collect from the caller.<br>Random numbers will be used for pre-authorization verifications. The order number should be used for post-authorizations.', 'selectBoxes(FG_INPUT_9,');
INSERT INTO `autopilot_fraudgate` VALUES ('FG_INPUT_10', 'Input 10', 'FUNCTION', 'no input required', 'The tenth input that you would like to collect from the caller.<br>Random numbers will be used for pre-authorization verifications. The order number should be used for post-authorizations.', 'selectBoxes(FG_INPUT_10,');
INSERT INTO `autopilot_fraudgate` VALUES ('s_status', 'Successfully verified transactions set to:', 'FUNCTION', '0', 'NOTE: Only for post authorization orders.\r\n<br>\r\nSet the status that the account should be set to if FraudGate successfully verifies the order.', 'selectBoxes3(s_status,');
INSERT INTO `autopilot_fraudgate` VALUES ('f_status', 'Failed transactions set to:', 'FUNCTION', '2', 'NOTE: Only for post authorization orders.\r\n<br>\r\nSet the status that the account should be set to if FraudGate fails to verify the transaction.', 'selectBoxes3(f_status,');
