Jump to content
Sign in to follow this  
Vger

[CONTRIBUTION] Authorize Net AIM module

Recommended Posts

I have one problem. Everything works exept when I run a transaction to test declines it takes me back to the payment page and spits out the error properly, but if I try to change the card info from that point on it holds onto the old card info.

 

ie. if I run a transaction as:

 

Bob Dole

4222222222222

exp date

cvv

 

and when its gets declined as it should, when I get redirected back to the payment page if I enter new info as:

 

G Bush

4007000000027

exp date

cvv

 

When I get to the confirmation page it still says Bob Dole and the declined card info.

 

Seems like Confirmation Page is not dumping the globals or something.

 

Any help would be appreciated.

 

Thanks.

 

Never mind fixed the error. Not sure where I went wrong or I would post a fix. I just uploaded I backup version and started over. I will look into this if anyone has similar errors

Share this post


Link to post
Share on other sites
I updated my Transaction Key and this error went away.

 

Rob,

I saw that you might have had a similar problem. Is this one a little different?:

 

checkout_payment.php?error_message=(TESTMODE)%20Credit%20card%20number%20is%20required.%20-%20Your+credit+card+could+not+be+authorized+for+this+reason.+Please+correct+any+i

nformation+and+try+again+or+contact+us+for+further+assistance.

 

I renewed my transaction key but had no such luck.

 

 

I'm on a GoDaddy host, and have my curl routed to their proxy hosts...have tried 3 other modules...and this one seems to be the closest. any help whatsoever would be greatly appreciated!

 

thanks

Share this post


Link to post
Share on other sites

well i have since moved from yahoo to godaddy but unfortuantley i cant get it to work either..

 

my alias for my cert is www.domain.com so i made this modification to the configure file for the https settings

 

Only have a receipt url listed for the success page and i even removed that and still doesnt work.

direct response is no comma & blank.

 

 

All I get now when i hit confirm is "page can not be found" with the url of https://www.domain.com/checkout_process.php

 

i can run throught default oscommerce authorize.net fine.

 

any thoughts?

 

If anyone here that has gotten this mod to work with godaddy hosting can you plesae post your file setup so that we may compare to see where or what we are doing wrong? thanks a million.

Share this post


Link to post
Share on other sites

ok guys/gals after a long time i have finally got this to work right ... for those of you using godaddy.com as your hosting provider i had to make the final setting changes to get this to work right:

 

 

for authorize.net settings:

no Default Reciept URL

no Default Relay Response URL

 

Delimited Response: No

Default Field Separator ,(comma)

Field Encapsulation Character blank

 

Must add the following per the dog to your authorizenet_aim.php file after the following line:

 

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

 

add this:

curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);

curl_setopt($ch, CURLOPT_PROXYTYPE, $CURLPROXY_HTTP);

curl_setopt($ch, CURLOPT_PROXY, "64.202.165.130:3128");

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

 

since godaddy makes the certificate alias with www.domain.com i had to make the following changes to the configure file:

 

PLEASE NOTE I DO NOT USE A "CATALOG" DIRECTORY.

 

define('HTTP_SERVER', 'http://www.domain.com'); // eg, http://localhost - should not be empty for productive servers

define('HTTPS_SERVER', 'https://www.domain.com'); // eg, https://localhost - should not be empty for productive servers

define('ENABLE_SSL', true); // secure webserver for checkout procedure?

define('HTTP_COOKIE_DOMAIN', 'www.domain.com');

define('HTTPS_COOKIE_DOMAIN', 'www.domain.com');

define('HTTP_COOKIE_PATH', '/');

define('HTTPS_COOKIE_PATH', '/');

define('DIR_WS_HTTP_CATALOG', '/');

define('DIR_WS_HTTPS_CATALOG', '/');

 

 

Now my only problem is my SSL i cant tell if there is a problem or not.

When clicking to go to a secure page i have a popup stating

"This page contains both secure and nonsecure items. Do you want to display the nonsecure items?"

 

If i select yes the page does not go secure and does not show the padlock in the right bottom corner.

If i select no the page does go secure and does show the padlock at the bottom.

 

weird thing is though when you hit no. that page looks normal.

i dont know if its something really non secure on this page.

 

my question is are customers supposed to click no on this option ? and should this popup come up on every secure page?

 

thanks

Edited by semorefred

Share this post


Link to post
Share on other sites

Customers will walk away if they see a security waning, so you need to get that resolved.

 

Vger

Share this post


Link to post
Share on other sites

got it fixed now.. my flash buttons had the HTTP://downloads.macrosmedia.com

 

i seen in another post here where you just remove the http: and make it //www.downloads.macrosmedia.com

 

 

now it works perfect and now there are no popups and all pages that should be secure have the pad lock and no more "nonsecure items" popups display any longer...

 

thanks

Edited by semorefred

Share this post


Link to post
Share on other sites

Has anyone figured out the order# error mentioned? I am experiencing a similar problem where my order# is always showing as 1 in my authorize control panel. If anyone has found a solution I would greatly appreate some help.

 

Thanks,

Mark

Share this post


Link to post
Share on other sites
Glad you like it!

 

Vger

 

 

okay i tried all the other contribs for autorize.net they all failed but then i tried this contrib .

 

first time 5 minutes later i was all set up and all went soooooo smoothly

 

thank you so much for the development and you time

 

RT :D

Share this post


Link to post
Share on other sites

Thanks for the Contribution, works great now!

 

Note to anyone else getting further "(TESMODE) ... " errors live or test -- carefully enabling/disabling your FDS (if applicable) is what got mine to work. I had AIM working previously, then enabled some FDS settings, then all hell broke loose...

 

Reverted back to default settings for now to debug :D

Share this post


Link to post
Share on other sites

I'm getting the following error when trying to go through checkout:

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/w/i/l/wildwoman/html/includes/modules/payment/authorizenet_aim.php:318) in /home/content/w/i/l/wildwoman/html/includes/functions/general.php on line 37

 

I've checked both files for white space, no luck...have no idea what else could be causing this. Any help would be appreciated. One of the moderators advised I should post here so someone can take a look at the code, thought it might be something in the aim contrib.

 

 

<?php

/* $Id: authorizenet_aim.php 8th March, 2006 23:39:00 Rhea Anthony $

Released under the GNU General Public License

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Original portions copyright 2003 osCommerce

Updated portions copyright 2004 Jason LeBaron (jason@networkdad.com)

Restoration of original portions and addition of new portions Copyright ? 2006 osCommerce

*/

 

 

class authorizenet_aim {

var $code, $title, $description, $enabled, $response;

 

// class constructor

function authorizenet_aim() {

 

$this->code = 'authorizenet_aim';

if ($_GET['main_page'] != '') {

$this->title = MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CATALOG_TITLE; // Module title in Catalog

} else {

$this->title = MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_ADMIN_TITLE; // Module title it Admin

}

$this->description = MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_DESCRIPTION; // Description of Module in Admin

$this->enabled = ((MODULE_PAYMENT_AUTHORIZENET_AIM_STATUS == 'True') ? true : false); // If the module is installed or not

$this->sort_order = MODULE_PAYMENT_AUTHORIZENET_AIM_SORT_ORDER; // Sort Order of this payment option on the checkout_payment.php page

$this->form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', true); // checkout_process.php - page to go to on completion

 

if ((int)MODULE_PAYMENT_AUTHORIZENET_AIM_ORDER_STATUS_ID > 0) {

$this->order_status = MODULE_PAYMENT_AUTHORIZENET_AIM_ORDER_STATUS_ID;

}

 

if (is_object($order)) $this->update_status();

 

}

 

 

// class methods

 

function update_status() {

global $order, $db;

 

if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_AUTHORIZENET_AIM_ZONE > 0) ) {

$check_flag = false;

$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_AUTHORIZENET_AIM_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");

while ($check = tep_db_fetch_array($check_query)) {

if ($check['zone_id'] < 1) {

$check_flag = true;

break;

} elseif ($check['zone_id'] == $order->billing['zone_id']) {

$check_flag = true;

break;

}

}

 

if ($check_flag == false) {

$this->enabled = false;

}

}

}

 

// Validate the credit card information via javascript (Number, Owner, and CVV Lengths)

function javascript_validation() {

$js = ' if (payment_value == "' . $this->code . '") {' . "\n" .

' var cc_owner = document.checkout_payment.authorizenet_aim_cc_owner.value;' . "\n" .

' var cc_number = document.checkout_payment.authorizenet_aim_cc_number.value;' . "\n";

if (MODULE_PAYMENT_AUTHORIZENET_AIM_USE_CVV == 'True') {

$js .= ' var cc_cvv = document.checkout_payment.authorizenet_aim_cc_cvv.value;' . "\n";

}

$js .= ' if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .

' error_message = error_message + "' . MODULE_PAYMENT_AUTHORIZENET_AIM_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_AIM_TEXT_JS_CC_NUMBER . '";' . "\n" .

' error = 1;' . "\n" .

' }' . "\n";

if (MODULE_PAYMENT_AUTHORIZENET_AIM_USE_CVV == 'True') {

$js .= ' if (cc_cvv == "" || cc_cvv.length < "3" || cc_cvv.length > "4") {' . "\n".

' error_message = error_message + "' . MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_JS_CC_CVV . '";' . "\n" .

' error = 1;' . "\n" .

' }' . "\n" .

' }' . "\n";

}

 

return $js;

}

 

// Display Credit Card information on the checkout_payment.php page

function selection() {

global $order;

 

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)));

}

if (MODULE_PAYMENT_AUTHORIZENET_AIM_USE_CVV == 'True') {

$selection = array('id' => $this->code,

'module' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CATALOG_TITLE,

'fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CREDIT_CARD_OWNER,

'field' => tep_draw_input_field('authorizenet_aim_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),

array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CREDIT_CARD_NUMBER,

'field' => tep_draw_input_field('authorizenet_aim_cc_number')),

array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CREDIT_CARD_EXPIRES,

'field' => tep_draw_pull_down_menu('authorizenet_aim_cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('authorizenet_aim_cc_expires_year', $expires_year)),

array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CVV,

'field' => tep_draw_input_field('authorizenet_aim_cc_cvv','',"size=4, maxlength=4"))));

} else {

$selection = array('id' => $this->code,

'module' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CATALOG_TITLE,

'fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CREDIT_CARD_OWNER,

'field' => tep_draw_input_field('authorizenet_aim_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),

array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CREDIT_CARD_NUMBER,

'field' => tep_draw_input_field('authorizenet_aim_cc_number')),

array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CREDIT_CARD_EXPIRES,

'field' => tep_draw_pull_down_menu('authorizenet_aim_cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('authorizenet_aim_cc_expires_year', $expires_year))));

}

return $selection;

}

 

 

// Evaluates the Credit Card Type for acceptance and validity of the Credit Card Number and Expiry Date

function pre_confirmation_check() {

global $_POST;

 

include(DIR_WS_CLASSES . 'cc_validation.php');

 

$cc_validation = new cc_validation();

$result = $cc_validation->validate($_POST['authorizenet_aim_cc_number'], $_POST['authorizenet_aim_cc_expires_month'], $_POST['authorizenet_aim_cc_expires_year'], $_POST['authorizenet_aim_cc_cvv']);

$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 false:

$error = TEXT_CCVAL_ERROR_INVALID_NUMBER;

break;

}

 

if ( ($result == false) || ($result < 1) ) {

$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&authorizenet_aim_cc_owner=' . urlencode($_POST['authorizenet_aim_cc_owner']) . '&authorizenet_aim_cc_expires_month=' . $_POST['authorizenet_aim_cc_expires_month'] . '&authorizenet_aim_cc_expires_year=' . $_POST['authorizenet_aim_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;

}

 

// Display Credit Card Information on the Checkout Confirmation Page

function confirmation() {

global $_POST;

 

if (MODULE_PAYMENT_AUTHORIZENET_AIM_USE_CVV == 'True') {

$confirmation = array(//'title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CATALOG_TITLE, // Redundant

'fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CREDIT_CARD_TYPE,

'field' => $this->cc_card_type),

array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CREDIT_CARD_OWNER,

'field' => $_POST['authorizenet_aim_cc_owner']),

array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_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_AIM_TEXT_CREDIT_CARD_EXPIRES,

'field' => strftime('%B, %Y', mktime(0,0,0,$_POST['authorizenet_aim_cc_expires_month'], 1, '20' . $_POST['authorizenet_aim_cc_expires_year']))),

array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CVV,

'field' => $_POST['authorizenet_aim_cc_cvv'])));

} else {

$confirmation = array(//'title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CATALOG_TITLE, // Redundant

'fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CREDIT_CARD_TYPE,

'field' => $this->cc_card_type),

array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_CREDIT_CARD_OWNER,

'field' => $_POST['authorizenet_aim_cc_owner']),

array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_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_AIM_TEXT_CREDIT_CARD_EXPIRES,

'field' => strftime('%B, %Y', mktime(0,0,0,$_POST['authorizenet_aim_cc_expires_month'], 1, '20' . $_POST['authorizenet_aim_cc_expires_year'])))));

}

 

return $confirmation;

}

 

function process_button() {

// Hidden fields on the checkout confirmation page

$process_button_string = tep_draw_hidden_field('cc_owner', $_POST['authorizenet_aim_cc_owner']) .

tep_draw_hidden_field('cc_expires', $this->cc_expiry_month . substr($this->cc_expiry_year, -2)) .

tep_draw_hidden_field('cc_type', $this->cc_card_type) .

tep_draw_hidden_field('cc_number', $this->cc_card_number);

if (MODULE_PAYMENT_AUTHORIZENET_AIM_USE_CVV == 'True') {

$process_button_string .= tep_draw_hidden_field('cc_cvv', $_POST['authorizenet_aim_cc_cvv']);

}

 

$process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id());

 

return $process_button_string;

return false;

}

 

function before_process() {

global $_POST, $response, $db, $order;

 

// DATA PREPARATION SECTION

unset($submit_data); // Cleans out any previous data stored in the variable

 

// Create a string that contains a listing of products ordered for the description field

$description = '';

for ($i=0; $i<sizeof($order->products); $i++) {

$description .= $order->products[$i]['name'] . '(qty: ' . $order->products[$i]['qty'] . ') + ';

}

// Strip the last "\n" from the string

$description = substr($description, 0, -2);

 

// Create a variable that holds the order time

$order_time = date("F j, Y, g:i a");

 

// Calculate the next expected order id

$last_order_id = tep_db_query("select * from " . TABLE_ORDERS . " order by orders_id desc limit 1");

$new_order_id = $last_order_id->fields['orders_id'];

$new_order_id = ($new_order_id + 1);

 

// Populate an array that contains all of the data to be submitted

$submit_data = array(

x_login => MODULE_PAYMENT_AUTHORIZENET_AIM_LOGIN, // The login name as assigned to you by authorize.net

x_tran_key => MODULE_PAYMENT_AUTHORIZENET_AIM_TXNKEY, // The Transaction Key (16 digits) is generated through the merchant interface

x_relay_response => 'FALSE', // AIM uses direct response, not relay response

x_delim_data => 'TRUE', // The default delimiter is a comma

x_version => '3.1', // 3.1 is required to use CVV codes

x_type => MODULE_PAYMENT_AUTHORIZENET_AIM_AUTHORIZATION_TYPE == 'Authorize' ? 'AUTH_ONLY': 'AUTH_CAPTURE',

x_method => 'CC', //MODULE_PAYMENT_AUTHORIZENET_AIM_METHOD == 'Credit Card' ? 'CC' : 'ECHECK',

x_amount => number_format($order->info['total'], 2),

x_card_num => $_POST['cc_number'],

x_exp_date => $_POST['cc_expires'],

x_card_code => $_POST['cc_cvv'],

x_email_customer => MODULE_PAYMENT_AUTHORIZENET_AIM_EMAIL_CUSTOMER == 'True' ? 'TRUE': 'FALSE',

x_email_merchant => MODULE_PAYMENT_AUTHORIZENET_AIM_EMAIL_MERCHANT == 'True' ? 'TRUE': 'FALSE',

x_cust_id => $_SESSION['customer_id'],

x_invoice_num => $new_order_id,

x_first_name => $order->billing['firstname'],

x_last_name => $order->billing['lastname'],

x_company => $order->billing['company'],

x_address => $order->billing['street_address'],

x_city => $order->billing['city'],

x_state => $order->billing['state'],

x_zip => $order->billing['postcode'],

x_country => $order->billing['country']['title'],

x_phone => $order->customer['telephone'],

x_email => $order->customer['email_address'],

x_ship_to_first_name => $order->delivery['firstname'],

x_ship_to_last_name => $order->delivery['lastname'],

x_ship_to_address => $order->delivery['street_address'],

x_ship_to_city => $order->delivery['city'],

x_ship_to_state => $order->delivery['state'],

x_ship_to_zip => $order->delivery['postcode'],

x_ship_to_country => $order->delivery['country']['title'],

x_description => $description,

// Merchant defined variables go here

Date => $order_time,

IP => $_SERVER['REMOTE_ADDR'],

Session => tep_session_id());

 

if(MODULE_PAYMENT_AUTHORIZENET_AIM_TESTMODE == 'Test') {

$submit_data['x_test_request'] = 'TRUE';

} else {

 

$submit_data['x_test_request'] = 'FALSE';

 

}

 

// concatenate the submission data and put into variable $data

while(list($key, $value) = each($submit_data)) {

$data .= $key . '=' . urlencode(ereg_replace(',', '', $value)) . '&';

}

 

// Remove the last "&" from the string

$data = substr($data, 0, -1);

 

 

// Post order info data to Authorize.net

// cURL must be compiled into PHP

// Connection must be https

// Test or Live Server address set

// using 'Test' or 'Live' mode in

// osCommerce admin panel

 

 

unset($response);

 

if (MODULE_PAYMENT_AUTHORIZENET_AIM_TESTMODE == 'Test') {

$url = 'https://secure.authorize.net/gateway/transact.dll'; // If this does not work then change 'secure' to 'certification' on this line

} else {

$url = 'https://secure.authorize.net/gateway/transact.dll';

}

 

$ch = curl_init();

 

curl_setopt($ch, CURLOPT_URL,$url);

 

curl_setopt($ch, CURLOPT_VERBOSE, 0);

 

curl_setopt($ch, CURLOPT_POST, 1);

 

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);

curl_setopt($ch, CURLOPT_PROXYTYPE, $CURLPROXY_HTTP);

curl_setopt($ch, CURLOPT_PROXY, "64.202.165.130:3128");

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$authorize = curl_exec($ch);

 

curl_close ($ch);

 

$response = split('\,', $authorize);

 

// Parse the response code and text for custom error display

$response_code = explode(',', $response[0]);

$response_text = explode(',', $response[3]);

$x_response_code = $response_code[0];

$x_response_text = $response_text[0];

// If the response code is not 1 (approved) then redirect back to the payment page with the appropriate error message

if ($x_response_code != '1') {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . $x_response_text . ' - ' . urlencode(MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_DECLINED_MESSAGE), 'SSL', true, false));

}

}

 

function after_process() {

return false;

}

 

function get_error() {

global $_GET;

 

$error = array('title' => MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_ERROR,

'error' => stripslashes(urldecode($_GET['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_AIM_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 AIM Module', 'MODULE_PAYMENT_AUTHORIZENET_AIM_STATUS', 'True', 'Do you want to accept Authorize.net payments via the AIM Method?', '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_AIM_LOGIN', 'Your User 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 ('Transaction Key', 'MODULE_PAYMENT_AUTHORIZENET_AIM_TXNKEY', '16 digit key', 'Transaction Key used for encrypting TP data', '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_AIM_TESTMODE', 'Test', 'Transaction mode used for processing orders', '6', '0', 'tep_cfg_select_option(array(\'Test\', \'Live\'), ', 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 ('Authorization Type', 'MODULE_PAYMENT_AUTHORIZENET_AIM_AUTHORIZATION_TYPE', 'Authorize/Capture', 'Do you want submitted credit card transactions to be authorized only, or authorized and captured?', '6', '0', 'tep_cfg_select_option(array(\'Authorize\', \'Authorize/Capture\'), ', 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_AIM_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 ('Merchant Notifications', 'MODULE_PAYMENT_AUTHORIZENET_AIM_EMAIL_MERCHANT', 'True', 'Should Authorize.Net e-mail a receipt to the merchant?', '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 ('Request CVV Number', 'MODULE_PAYMENT_AUTHORIZENET_AIM_USE_CVV', 'True', 'Do you want to ask the customer for the card\'s CVV number', '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 ('Sort order of display.', 'MODULE_PAYMENT_AUTHORIZENET_AIM_SORT_ORDER', '0', 'Sort order of display. 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, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_AUTHORIZENET_AIM_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");

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_AIM_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())");

}

 

function remove() {

 

tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");

}

 

function keys() {

return array('MODULE_PAYMENT_AUTHORIZENET_AIM_STATUS', 'MODULE_PAYMENT_AUTHORIZENET_AIM_LOGIN', 'MODULE_PAYMENT_AUTHORIZENET_AIM_TXNKEY', 'MODULE_PAYMENT_AUTHORIZENET_AIM_TESTMODE', 'MODULE_PAYMENT_AUTHORIZENET_AIM_AUTHORIZATION_TYPE', 'MODULE_PAYMENT_AUTHORIZENET_AIM_EMAIL_CUSTOMER', 'MODULE_PAYMENT_AUTHORIZENET_AIM_EMAIL_MERCHANT', 'MODULE_PAYMENT_AUTHORIZENET_AIM_USE_CVV', 'MODULE_PAYMENT_AUTHORIZENET_AIM_SORT_ORDER', 'MODULE_PAYMENT_AUTHORIZENET_AIM_ZONE', 'MODULE_PAYMENT_AUTHORIZENET_AIM_ORDER_STATUS_ID'); //'MODULE_PAYMENT_AUTHORIZENET_AIM_METHOD'

}

}

?>

Share this post


Link to post
Share on other sites

I see that you've been altering what you think is white space in the code, by removing indents etc. but this is not what is meant by 'white space' - which is space before the opening or after the closing php tags on the page.

 

Line 318 is this piece of code:

$authorize = curl_exec($ch);

 

Read back through this thread for people who have had problems with cURL on their server because that may also hold a solution.

 

The module itself is fine.

 

Vger

Share this post


Link to post
Share on other sites
I see that you've been altering what you think is white space in the code, by removing indents etc. but this is not what is meant by 'white space' - which is space before the opening or after the closing php tags on the page.

 

Line 318 is this piece of code:

$authorize = curl_exec($ch);

 

Read back through this thread for people who have had problems with cURL on their server because that may also hold a solution.

 

The module itself is fine.

 

Vger

 

 

Thanks Vger, someone else helped me find the error - I just had to add the following line of code right before line 318:

 

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

 

thought I'd post in case someone else runs into the same problem.

Share this post


Link to post
Share on other sites

I love this module. Its great..

 

however,

 

I got it to work but I get "page cannot be displayed" error during checkout_process.php...

 

i get confirmation e-mails and everything..

 

any suggestions? i think it's just a simple configuration mistake.

Share this post


Link to post
Share on other sites

If you are getting a 'page cannot be displayed' error at what point of the checkout process is it happening? I am assuming that it must be checkout_success or else you wouldn't know if an order was successful or not. Check in includes/configure.php that your http and https cookie domains are set up correctly. cookie_domain settings are for domains and not url's - so they should not contain http:// or https://

 

Vger

Share this post


Link to post
Share on other sites

Hello i am using this module with great success but my clients are asking why they cannot pick what credit card to use

:visa, mastercard so can i create a form even if it is a dummy form so the site looks more like other online sites where they choose there cc type, and when i create this form do i put it in the AAim php file , or what file

 

thanks

RT

:D

Share this post


Link to post
Share on other sites

Hi, I offer support here for people who are having trouble installing and getting the module to work - but if people want additional features then I haven't got the time to do that for them.

 

Vger

Share this post


Link to post
Share on other sites

Does your Contrib. play well with PayPal IPN? I am using Authorize.net Consolidated and since it has been 'discontinued' I have lost hope of fixing the following error:

EITHER PayPal or Authorize works fine but the best I can get them both configured leaves PayPal returning the "cannot redeclare class" error upon returning from PayPal after a successfull transaction.

 

Thanks!

Share this post


Link to post
Share on other sites

Hi, They should work fine together - provided you don't have CCGV (Credit Class and Gift Vouchers) installed as well. If you do then you have to move a line of code for CCGV to work with Authorize Net AIM, hwich then causes a class error with any other payment module.

 

Vger

Share this post


Link to post
Share on other sites

Hi- thanks so much for making this contrib- I just hope I can get it working...

 

I did have Authorizenet Consolidated during the Holidays and worked just fine, but stopped working recently and can't find it anymore. So trying to get this one to work... and have a couple probs.

 

I am getting a "This Page Cannot Be Displayed" on checkout_process.php

 

Don't know why this happening. I read what you said a few posts ago about checking all the settings in the config, which I did.

 

Can you think of anything else that may be happening which would cause this?

 

Thanks so much for any help you could provide.

Share this post


Link to post
Share on other sites
I am getting a "This Page Cannot Be Displayed" on checkout_process.php

 

Do you have ssl configured - but no ssl cert? You need an https connection to be able to connect to Authorize Net anyway.

 

Do you have 'Use Search Engine Friendly URL's' turned on under Configuration --> Sessions? If so, turn them off and try again.

 

Vger

Share this post


Link to post
Share on other sites

Hello,

 

First, thank you! for this contribution. It has helped me greatly and was extremely easy to install and use. I've had no problems.

 

My question is a minor one (and pardon my ignorance if this makes no sense). This module submits the invoice number to Authnet, excellent. However, when I check my unsettled transactions the invoice number is the same for every order: 1. How do I get it to submit the correct order ID? The invoice numbers in mySQL DB (orders_id column) increment correctly.

 

I thought maybe that this line:

x_invoice_num => $new_order_id,

in authorizenet_aim.php would need to match the column heading in my DB (i.e. the $new_order_id should be $orders_id) but all that change did was to not send an invoice number to Authnet at all.

 

Please help me with this if you don't mind.

 

Thanks!

Stephaney

Share this post


Link to post
Share on other sites

You can try this, but it's untested and may not work:

 

'x_invoice_num' =>$_POST number_format($order_id),

 

The problem basically is not with the module, but with the Authorize Net end of things not incrementing the new_order_id

 

Vger

Share this post


Link to post
Share on other sites
You can try this, but it's untested and may not work:

 

'x_invoice_num' =>$_POST number_format($order_id),

 

The problem basically is not with the module, but with the Authorize Net end of things not incrementing the new_order_id

 

Vger

 

Thanks for your help.

 

It gave this error: Parse error: parse error, unexpected T_STRING, expecting ')'

 

Any ideas?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×