NiceGuyEd Posted January 10, 2005 Share Posted January 10, 2005 (edited) Hello all, I recently got my download controller / Authorize.net module running in my downloadable media shop. (Thanks Chris!) Everything seems to be fine except for one small problem... er, I hope it's small. ;) A test product is set up and the appropriate attribute for download have been set. The Authorize.net module is configured properly and my Authorize.net account is set in TEST mode. I seem to be able to complete a checkout using a test credit card with absolutely no errors. I'm receiving the confirmation emails and everything. The problem is that I get no download link... that is, until I go to admin and set the 'pending' order to 'delivered'. Then when I return to my checkout confirmation page and hit refresh, the download link appears. I know this should be setting it to 'delivered' automatically. :blush: Where should I be looking to solve this problem? I don't even know where to start. Thanks for any insight! Ed Edited January 10, 2005 by NiceGuyEd Quote Link to comment Share on other sites More sharing options...
OceanRanch Posted January 10, 2005 Share Posted January 10, 2005 (edited) My 2 cents Ed.... :P Two areas need to be addressed. 1. In your authorize.net paymodule administration area in osc you should be able able to set the order status that will be set upon successful payment. (Perhaps "delivered in your case) 2. Delivered implies that the product has been payed for and delivered. So you may need to change the type of transaction on authorize.net from "authorize funds" to "charge the credit card" or complete the payment or whatever wording authorize.net needs. That setting may or may not be in osc, you may need to set that in the authorize.net admin area on their site. Also, since you are still in TEST mode that may have some beraing on what they allow you to do (maybe not though). HTH Tom Edited January 10, 2005 by OceanRanch Quote Link to comment Share on other sites More sharing options...
NiceGuyEd Posted January 11, 2005 Author Share Posted January 11, 2005 (edited) Thanks for the reply Tom. :) I'm still having the same problem. Can't for the life of me think of the right spot to look. :blush: As far as my osC Authorize.net module setup: I'm set to Authorize and Capture, have the cURL address set (/usr/bin/curl), Testing mode on, Transaction Method: credit, and proper login User and Transaction Key (which I just reobtained from payment gateway). I'm running the download controller with this and I'm quite sure it works (or isn't the root of the problem) because I am indeed getting the download link when I manually set the order to 'delivered'. I also have it set to send confirmation emails, which I am getting after the checkout completion. As far as the Auth.net gateway account setup? I have it set in TEST mode, set the email receipts (getting these as well), and I have the Relay Response pointing at the checkout_process.php file. The only thing I'm seeing that I'm not sure about is the option for 'Direct Response Delimiter'. Do I need that? By default it is set to 'Yes', and in the Field for: 'Default Field Separator', ',(comma)' is selected. Any ideas? :D ps... I've also tried a checkout in live mode with the same outcome. :blink: Edited January 11, 2005 by NiceGuyEd Quote Link to comment Share on other sites More sharing options...
NiceGuyEd Posted January 11, 2005 Author Share Posted January 11, 2005 One thing I noticed... As I said, I tried a live checkout, but I just tried it again and noticed that from within my Authorize.net gateway Unsettled Transactions list, it's listing the transaction as Captured/Pending Settlement... Even after I manually set the order from 'pending' to 'delivered' from within osC admin/orders. Quote Link to comment Share on other sites More sharing options...
OceanRanch Posted January 11, 2005 Share Posted January 11, 2005 "Authorize and Capture" is the same as "Pending". To have the order set to "delivered" I'm pretty sure you have to "Charge" the card not just "authorize" the payment. With your current setup, authorize.net will "reserve" or "authorize" payment but not charge the card. The paymnet software will then set the order to pending. Inorder to get your money, you need to manually set the order to delivered, and then connect up to authorize.net independently (not thru oscommerce) to actually complete the sale and charge the card. You can however setup authorize.net to "charge" the card right away at order time, and then the oscommerce order should get set to "delivered" at that time. HTH Tom Quote Link to comment Share on other sites More sharing options...
NiceGuyEd Posted January 11, 2005 Author Share Posted January 11, 2005 Thanks again for your reply. What you are saying makes perfect sense; however, I'm having difficulty finding the appropriate settings. The only settings in my osC admin panel/Auth.net are: 'Authorize Only' and 'Authorize and Capture'. I've tried both with the same outcome. Note: when I choose 'Authorize' in my osC Auth.net settings, I'm getting a transaction status of "Authorize/Pending Capture" in my Authnet Account gateway settings. When I choose 'Authorize and Capture' in my osC AUth.net settings, I'm getting a transaction status of "Captured/Pending Settlement". Does this lead us to believe it has nothing to do with my osC Auth.net setup and all to do with my Account Gateway Setup? In my Auth.net gateway account settings, the only relevant options I'm seeing are to turn TEST mode on and off as well as the relay response setups. No 'charge card' or 'charge' to speak of. Any insight? Quote Link to comment Share on other sites More sharing options...
OceanRanch Posted January 11, 2005 Share Posted January 11, 2005 (edited) The standard authorize.net install module has the following configuration table entry tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_AUTHORIZENET_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); As you can see there should be an option in the osCommerce admin payment panel for you to choose which "status" (i.e. "delivered") to use when there is a succcessful transaction with authorize.net. Setting it to "delivered" also assumes that you have "collected" or charged the credit card. You will need to setup your authorize.net Gateway to charge the credit card as well. Tom Edited January 11, 2005 by OceanRanch Quote Link to comment Share on other sites More sharing options...
OceanRanch Posted January 11, 2005 Share Posted January 11, 2005 Since I don't have authorize.net installed and configured and I'm not near a test system, it might be that if you DO NOT have this configuration option via osc admin to set the order status, it may have been only during the payment install that you get to set it. If so then you could edit the config value in the database via phpmyadmin by looking at the configuration table and editing it directly. Quote Link to comment Share on other sites More sharing options...
NiceGuyEd Posted January 11, 2005 Author Share Posted January 11, 2005 I'm going to call Authorize.Net concerning options there, but as far as the osC/admin/Authorize.Net settings, I'm still not seeing any reference to what you are describing. The following is a section from the contribution's readme file. It describes the options in the admin. EDIT OPTIONS: Upon installing this contribution via the Admin panel, select "edit" to input your information. You will be presented with many options you need to fill in for this contribution to function properly: Enable Authorize.net Module - Whether to use Authorize.net Consolidated to accept credit card payments (true if installed) Login Username - Your alphanumeric username given to you by Authorize.net (the same used to login to their website) Login Transaction Key - Your alphanumeric transaction key given to you by Authorize.net (can be generated from their website in Settings->Obtain Transaction Key) cURL Setup - Whether you are running cURL compiled into PHP or as a standalone binary (Windows users are standalone binaries, Linux/Unix can be either, ask your host) cURL Path - The full path to your curl binary (ex: curl.exe). This is necessary only if you are running cURL as Not Compiled, and must include the curl file as part of the path (i.e. c:/curl/curl). Note to Windows users: you must use the '/' as your directory separator, as '\'s are used as escape characters in PHP Transaction Mode - The mode you wish to run your shopping cart in (Test, Test And Debug, Production). Test mode will only accept test credit card numbers as given by Authorize.net, and will not process these credit card numbers. Test And Debug mode will do the same as test mode, but will also dump the output being sent to Authorize.net into the file "authnet_debug.txt" in your /catalog/ directory. The following numbers are credit card test numbers given by Authorize.net: 370000000000002 American Express 6011000000000012 Discover 5424000000000015 MasterCard 4007000000027 Visa Any expiration date after the current date and any CVV code will work. Transaction Method - The transaction method you are using to process orders. Currently only Credit Card is supported. Processing Mode - The mode used to process credit cards. Authorize And Capture will validate credit cards and charge them the full amount. Authorize Only will only validate credit cards for them to be charged later via Authorize.net's online gateway. Currently these are the only modes supported. Sort Order Of Display - The order in which this payment method is displayed with respect to other payment methods on the checkout_payment.php page. Lower numbers are displayed above higher ones. Customer Notifications - Controls whether e-mail receipts should be sent directly from Authorize.net to the customer. Accepted Credit Cards - Which cards the gateway is currently set up to accept. Currently only American Express, Discover, Mastercard, and Visa are supported. And I am indeed using the newest contribution of Authorize.net. At the top of the edit screen, it says: Authorize.net Consolidated v1.7 by Austin519 :blush: Quote Link to comment Share on other sites More sharing options...
NiceGuyEd Posted January 11, 2005 Author Share Posted January 11, 2005 (edited) Since I don't have authorize.net installed and configured and I'm not near a test system, it might be that if you DO NOT have this configuration option via osc admin to set the order status, it may have been only during the payment install that you get to set it. If so then you could edit the config value in the database via phpmyadmin by looking at the configuration table and editing it directly. <{POST_SNAPBACK}> Gotcha... we posted at the same time. As far as editing the config value in the database?.... EEK! :o:P :D I have no idea how to do that. Any simple instructions? I know how to get into phpMyAdmin and open the database... Edited January 11, 2005 by NiceGuyEd Quote Link to comment Share on other sites More sharing options...
NiceGuyEd Posted January 12, 2005 Author Share Posted January 12, 2005 (edited) Hey Tom. I got rid of that server/curl error I had mentioned I was having by reinstalling the module and getting a new transaction key. Dunno what that was about? :P I'm just glad it's gone. As far as the "pending" problem... (play on words? :D) I have followed instructions that were posted by someone in the AIM support thread concerning altering the catalog/includes/modules/payment/authorizenet.php file. It seems the order status option was left out of the 1.7 version of AIM consolidated and is expected in the 1.8 version. I now have that option in my admin after making the modifications. I then reinstalled the module in admin and now I have an order status options in there. I set it to delivered yet I'm still getting no download link after the checkout. Any ideas? I feel like Im almost there! :D Edited January 12, 2005 by NiceGuyEd Quote Link to comment Share on other sites More sharing options...
NiceGuyEd Posted January 12, 2005 Author Share Posted January 12, 2005 (edited) Here's my new authorizenet.php file. I'm leaving out all the license/credits for viewing sake. They are indeed included in my version. My payment gateway is listing the transaction as: 'Captured/Pending Settlement' <?php ?class authorizenet { ? var $code, $title, $description, $enabled, $sort_order; ? var $accepted_cc, $card_types, $allowed_types, $order_status; // class constructor ? ?function authorizenet() { ? ? ?$this->code = 'authorizenet'; ? ? ?$this->title = MODULE_PAYMENT_AUTHORIZENET_TEXT_TITLE; ? ? ?$this->description = MODULE_PAYMENT_AUTHORIZENET_TEXT_DESCRIPTION; $this->sort_order = MODULE_PAYMENT_AUTHORIZENET_SORT_ORDER; // Begin I added this for order status if ((int)MODULE_PAYMENT_AUTHORIZENET_ORDER_STATUS_ID > 0) { $this->order_status = MODULE_PAYMENT_AUTHORIZENET_ORDER_STATUS_ID; } // End ? ? ?$this->enabled = ((MODULE_PAYMENT_AUTHORIZENET_STATUS == 'True') ? true : false); $this->accepted_cc = MODULE_PAYMENT_AUTHORIZENET_ACCEPTED_CC; //array for credit card selection $this->card_types = array('Visa' => MODULE_PAYMENT_AUTHORIZENET_TEXT_VISA, ? ?'Mastercard' => MODULE_PAYMENT_AUTHORIZENET_TEXT_MASTERCARD, ? ?'Amex' => MODULE_PAYMENT_AUTHORIZENET_TEXT_AMEX, ? ?'Discover' => MODULE_PAYMENT_AUTHORIZENET_TEXT_DISCOVER); ? ? $this->allowed_types = array(); // Credit card pulldown list $cc_array = explode(', ', MODULE_PAYMENT_AUTHORIZENET_ACCEPTED_CC); while (list($key, $value) = each($cc_array)) { ?$this->allowed_types[$value] = $this->card_types[$value]; } // Processing via Authorize.net AIM ? ? ?$this->form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false); ? ?} // class methods //concatenate to get CC images function get_cc_images() { $cc_images = ''; reset($this->allowed_types); while (list($key, $value) = each($this->allowed_types)) { ?$cc_images .= tep_image(DIR_WS_ICONS . $key . '.gif', $value); } return $cc_images; } function javascript_validation() { ? ? ?$js = ' ?if (payment_value == "' . $this->code . '") {' . "\n" . ? ? ? ? ? ?' ? ?var cc_owner = document.checkout_payment.authorizenet_cc_owner.value;' . "\n" . ? ? ? ? ? ?' ? ?var cc_number = document.checkout_payment.authorizenet_cc_number.value;' . "\n" . ? ? ? ? ? ?' ? ?var cc_cvv = document.checkout_payment.cvv.value;' . "\n" . ? ? ? ? ? ?' ? ?if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" . ? ? ? ? ? ?' ? ? ?error_message = error_message + "' . MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_OWNER . '";' . "\n" . ? ? ? ? ? ?' ? ? ?error = 1;' . "\n" . ? ? ? ? ? ?' ? ?}' . "\n" . ? ? ? ? ? ?' ? ?if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" . ? ? ? ? ? ?' ? ? ?error_message = error_message + "' . MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_NUMBER . '";' . "\n" . ? ? ? ? ? ?' ? ? ?error = 1;' . "\n" . ? ? ? ? ? ?' ? ?}' . "\n" . ? ? ? ? ? ?' ? ?if (cc_cvv != "" && cc_cvv.length < "3") {' . "\n". ? ? ? ? ? ?' ? ? ?error_message = error_message + "' . MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_CVV . '";' . "\n" . ? ? ? ? ? ?' ? ? ?error = 1;' . "\n" . ? ? ? ? ? ?' ? ?}' . "\n" . ? ? ? ? ? ?' ?}' . "\n"; ? ? ?return $js; ? ?} ? ?function selection() { ? ? ?global $order; reset($this->allowed_types); while (list($key, $value) = each($this->allowed_types)) { ?$card_menu[] = array('id' => $key, 'text' => $value); } ? ? ?for ($i=1; $i<13; $i++) { ? ? ? ?$expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000))); ? ? ?} ? ? ?$today = getdate(); ? ? ?for ($i=$today['year']; $i < $today['year']+10; $i++) { ? ? ? ?$expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i))); ? ? ?} $selection = array('id' => $this->code, ?'module' => $this->title . ' ' . $this->get_cc_images(), ?'fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_TYPE, ? 'field' => tep_draw_pull_down_menu('credit_card_type', $card_menu)), ?array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_OWNER, ? 'field' => tep_draw_input_field('authorizenet_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])), ?array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_NUMBER, ? 'field' => tep_draw_input_field('authorizenet_cc_number')), ?array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_EXPIRES, ? 'field' => tep_draw_pull_down_menu('authorizenet_cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('authorizenet_cc_expires_year', $expires_year)), ?array('title' => 'CVV number ' . ' ' .'<a href="javascript:CVVPopUpWindow(\'' . tep_href_link('cvv.html') . '\')">' . '<u><i>' . '(' . MODULE_PAYMENT_AUTHORIZENET_TEXT_CVV_LINK . ')' . '</i></u></a>', ? 'field' => tep_draw_input_field('cvv','',"SIZE=4, MAXLENGTH=4")))); ? ? ? return $selection; ? ?} ? ?function pre_confirmation_check() { ? ? ?global $HTTP_POST_VARS, $cvv; ? ? ?include(DIR_WS_CLASSES . 'cc_validation.php'); ? ? ?$cc_validation = new cc_validation(); $result = $cc_validation->validate($HTTP_POST_VARS['authorizenet_cc_number'], $HTTP_POST_VARS['authorizenet_cc_expires_month'], $HTTP_POST_VARS['authorizenet_cc_expires_year'], $HTTP_POST_VARS['cvv'], $HTTP_POST_VARS['credit_card_type']); ? ? ?$error = ''; switch ($result) { ?case -1: ? $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4)); ? break; ?case -2: ?case -3: ?case -4: ? $error = TEXT_CCVAL_ERROR_INVALID_DATE; ? break; ?case -5: ? $error = TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH; ? break; ?case -6; ? $error = TEXT_CCVAL_ERROR_CVV_LENGTH; ? break; ?case false: ? $error = TEXT_CCVAL_ERROR_INVALID_NUMBER; ? break; } ? ? ?if ( ($result == false) || ($result < 1) ) { ? ? ? ?$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&authorizenet_cc_owner=' . urlencode($HTTP_POST_VARS['authorizenet_cc_owner']) . '&authorizenet_cc_expires_month=' . $HTTP_POST_VARS['authorizenet_cc_expires_month'] . '&authorizenet_cc_expires_year=' . $HTTP_POST_VARS['authorizenet_cc_expires_year']; ? ? ? ?tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); ? ? ?} ? ? ?$this->cc_card_type = $cc_validation->cc_type; ? ? ?$this->cc_card_number = $cc_validation->cc_number; ? ? ?$this->cc_expiry_month = $cc_validation->cc_expiry_month; ? ? ?$this->cc_expiry_year = $cc_validation->cc_expiry_year; ? ? ?$x_Card_Code = $HTTP_POST_VARS['cvv']; ? ?} ? ?function confirmation() { ? ? ?global $HTTP_POST_VARS, $x_Card_Code; ? ? ? $x_Card_Code=$HTTP_POST_VARS['cvv']; ? ? ? $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type, ? ? ? ? ? ? ? ? ? ? ? ? ? ?'fields' => array(array('title' => 'CVV number', ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'field' => $HTTP_POST_VARS['cvv']), ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_OWNER, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'field' => $HTTP_POST_VARS['authorizenet_cc_owner']), ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_NUMBER, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)), ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_EXPIRES, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['authorizenet_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['authorizenet_cc_expires_year']))))); ? ? ?$x_Card_Code=$HTTP_POST_VARS['cvv']; ? ? ?return $confirmation; ? ?} ? ?function process_button() { ? ?// Change made by using ADC Direct Connection ? ? ? ?$x_Card_Code=$HTTP_POST_VARS['cvv']; ? ? ?$process_button_string = tep_draw_hidden_field('x_Card_Code', $HTTP_POST_VARS['cvv']) . ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? tep_draw_hidden_field('x_Card_Num', $this->cc_card_number) . ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? tep_draw_hidden_field('x_Exp_Date', $this->cc_expiry_month . substr($this->cc_expiry_year, -2)); ? ? ?$process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id()); ? ? ?return $process_button_string; ? ?} ? ?function before_process() { ? global $response; ? ? // Change made by using ADC Direct Connection ?$response_vars = explode(',', $response[0]); ?$x_response_code = $response_vars[0]; ?$x_response_subcode = $response_vars[1]; ?$x_response_reason_code = $response_vars[2]; ?$x_response_reason_text = $response_vars[3]; if ($x_response_code != '1') { ?tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$insert_id . "'"); //Remove order ?if($x_response_code == '') { ? tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('The server cannot connect to Authorize.net. ?Please check your cURL and server settings.'), 'SSL', true, false)); ?} ?else if($x_response_code == '2') { ? tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('Your credit card was declined ') . urlencode('(') . urlencode("$x_response_reason_code") . urlencode('): ') . urlencode("$x_response_reason_text"), 'SSL', true, false)); ?} ?else if($x_response_code == '3') { ? tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('There was an error processing your credit card ') . urlencode('(') . urlencode("$x_response_reason_code") . urlencode('): ') . urlencode("$x_response_reason_text"), 'SSL', true, false)); ?} ?else { ? ? ? ?tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('There was an unspecified error processing your credit card.'), 'SSL', true, false)); ?} } ? ?} ? ?function after_process() { ? ? ?return false; ? ?} ? ?function get_error() { ? ? ?global $HTTP_GET_VARS; ? ? ?$error = array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR, ? ? ? ? ? ? ? ? ? ? 'error' => stripslashes(urldecode($HTTP_GET_VARS['error']))); ? ? ?return $error; ? ?} ? ?function check() { ? ? ?if (!isset($this->_check)) { ? ? ? ?$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_AUTHORIZENET_STATUS'"); ? ? ? ?$this->_check = tep_db_num_rows($check_query); ? ? ?} ? ? ?return $this->_check; ? ?} ? ?function install() { ? ? ?tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Authorize.net Module', 'MODULE_PAYMENT_AUTHORIZENET_STATUS', 'True', 'Do you want to accept payments through Authorize.net?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); ? ? ?tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Login Username', 'MODULE_PAYMENT_AUTHORIZENET_LOGIN', 'Your Login Name', 'The login username used for the Authorize.net service', '6', '0', now())"); ? ? ?tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Login Transaction Key', 'MODULE_PAYMENT_AUTHORIZENET_TRANSKEY', 'Your Transaction Key', 'The transaction key used for the Authorize.net service', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('cURL Setup', 'MODULE_PAYMENT_AUTHORIZENET_CURL', 'Not Compiled', 'Whether cURL is compiled into PHP or not. ?Windows users, select not compiled.', '6', '0', 'tep_cfg_select_option(array(\'Not Compiled\', \'Compiled\'), ', now())"); ? ? ?tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('cURL Path', 'MODULE_PAYMENT_AUTHORIZENET_CURL_PATH', 'The Path To cURL', 'For Not Compiled mode only, input path to the cURL binary (i.e. c:/curl/curl)', '6', '0', now())"); ? ? ?tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_AUTHORIZENET_TESTMODE', 'Test', 'Transaction mode used for processing orders', '6', '0', 'tep_cfg_select_option(array(\'Test\', \'Test And Debug\', \'Production\'), ', now())"); ? ? ?tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Method', 'MODULE_PAYMENT_AUTHORIZENET_METHOD', 'Credit Card', 'Transaction method used for processing orders', '6', '0', 'tep_cfg_select_option(array(\'Credit Card\', \'eCheck\'), ', now())"); ? ? ?tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Processing Mode', 'MODULE_PAYMENT_AUTHORIZENET_CCMODE', 'Authorize And Capture', 'Credit card processing mode', '6', '0', 'tep_cfg_select_option(array(\'Authorize And Capture\', \'Authorize Only\'), ', now())"); ? ? ?tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order Of Display', 'MODULE_PAYMENT_AUTHORIZENET_SORT_ORDER', '1', 'The order in which this payment type is dislayed. Lowest is displayed first.', '6', '0' , now())"); ? ? ?tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Customer Notifications', 'MODULE_PAYMENT_AUTHORIZENET_EMAIL_CUSTOMER', 'False', 'Should Authorize.Net e-mail a receipt to the customer?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Accepted Credit Cards', 'MODULE_PAYMENT_AUTHORIZENET_ACCEPTED_CC', 'Mastercard, Visa', 'The credit cards you currently accept', '6', '0', '_selectOptions(array(\'Visa\', \'Mastercard\', \'Amex\',\'Discover\'), ', now())"); ?// BEGIN I ADDED THIS FOR ORDER STATUS SETTING tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_AUTHORIZENET_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); // END ? } ? ?function remove() { ? ? ?$keys = ''; ? ? ?$keys_array = $this->keys(); ? ? ?for ($i=0; $i<sizeof($keys_array); $i++) { ? ? ? ?$keys .= "'" . $keys_array[$i] . "',"; ? ? ?} ? ? ?$keys = substr($keys, 0, -1); ? ? ?tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")"); ? ?} // BEGIN CHANGED FOR STATUS SETTING function keys() { return array('MODULE_PAYMENT_AUTHORIZENET_STATUS', 'MODULE_PAYMENT_AUTHORIZENET_LOGIN', 'MODULE_PAYMENT_AUTHORIZENET_TRANSKEY', 'MODULE_PAYMENT_AUTHORIZENET_CURL', 'MODULE_PAYMENT_AUTHORIZENET_CURL_PATH', 'MODULE_PAYMENT_AUTHORIZENET_TESTMODE', 'MODULE_PAYMENT_AUTHORIZENET_METHOD', 'MODULE_PAYMENT_AUTHORIZENET_CCMODE', 'MODULE_PAYMENT_AUTHORIZENET_SORT_ORDER', 'MODULE_PAYMENT_AUTHORIZENET_EMAIL_CUSTOMER', 'MODULE_PAYMENT_AUTHORIZENET_ACCEPTED_CC' , 'MODULE_PAYMENT_AUTHORIZENET_ORDER_STATUS_ID'); } // END ?} // Authorize.net Consolidated Credit Card Checkbox Implementation // Code from UPS Choice v1.7 - Fritz Clapp (aka dreamscape, thanks Fritz!) function _selectOptions($select_array, $key_value, $key = '') { for ($i=0; $i<(sizeof($select_array)); $i++) { ?$name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value'); ?$string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"'; ?$key_values = explode(", ", $key_value); ?if (in_array($select_array[$i], $key_values)) $string .= ' checked="checked"'; ?$string .= '> ' . $select_array[$i]; } return $string; } ?> Edited January 12, 2005 by NiceGuyEd Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.