Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Authorize.net AIM Problem


clay584

Recommended Posts

On my E-Commerce site, when the user goes to check out, they are only charged 35% of the total cost plus shipping and handling costs.

 

I edited the line in bold listed below from x_amount => number_format($order->info['total'], 2) to number_format($order->info['shipping_cost']+$cart->show_downpayment(), 2)

 

After doing this the AIM module gives a fatal error. Any ideas on how to fix this to charge the credit card for the correct amount?

---------------------------------------------------------------------------------------------------------------------------

excerpt from includes/modules/payment/authorize_aim.php...

---------------------------------------------------------------------------------------------------------------------------

// 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'] + 0, // CVV doesn't correctly get passed w/o explicit conversion

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_customer_ip => $_SERVER['REMOTE_ADDR'],

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,

 

---------------------------------------------------------------------------------------------------------------------------

Link to comment
Share on other sites

  • 2 months later...

Are you sure that show_downpayment() is returning something that can be added? It looks like it is returning a string?

 

On my E-Commerce site, when the user goes to check out, they are only charged 35% of the total cost plus shipping and handling costs.

 

I edited the line in bold listed below from x_amount => number_format($order->info['total'], 2) to number_format($order->info['shipping_cost']+$cart->show_downpayment(), 2)

 

After doing this the AIM module gives a fatal error. Any ideas on how to fix this to charge the credit card for the correct amount?

---------------------------------------------------------------------------------------------------------------------------

excerpt from includes/modules/payment/authorize_aim.php...

---------------------------------------------------------------------------------------------------------------------------

// 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'] + 0, // CVV doesn't correctly get passed w/o explicit conversion

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_customer_ip => $_SERVER['REMOTE_ADDR'],

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,

 

---------------------------------------------------------------------------------------------------------------------------

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...