Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

What does


NodsDorf

Recommended Posts

Posted

Background: Authorize.net AIM module

Problem: Authorize.net always receives an invoice number of 1 no matter what order number we are on.

 

Code: from catalog/includes/modules/authorizenet_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'],
  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());

 

Statement: it appears in the above code, the invoice number in the array is declared by the following: x_invoice_num => $new_order_id,

Question: is the $new_order_id a oscommerce function that will always call the number 1? Is there another statement we can use to get the actual order number? If our OSC order number is 19930 this is the invoice number we want passed to Authorize.net.

 

Any help always appreciated.

 

Thank you,

Don

Posted

Sorry I didn't get the subject of this post right. Hopefully somebody still knows.

 

 

Thanks,

Don

  • 8 months later...
Posted

Sorry I didn't get the subject of this post right. Hopefully somebody still knows.

 

 

Thanks,

Don

 

Hello Don, Happy New Year...did you ever have any luck getting this rolling?

 

Thanks...Jim

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...