authorize.net AIM description field

  • Posts: 38
  • Thank you received: 0
12 years 8 months ago #24453

I would like the description field in the authorize.net transaction populated with the product description or product item number. How can I do this?

Thanks for your help.

Please Log in or Create an account to join the conversation.

  • Posts: 81563
  • Thank you received: 13071
  • MODERATOR
12 years 8 months ago #24455

The product code is already sent to authorize.net for each product. If you want to add the product description to the product name, you need to do that by changing the line
$vars["x_line_item"][]=substr($product->order_product_code,0,30).'<|>'.substr(strip_tags($product->order_product_name),0,30).'<|><|>'.$product->order_product_quantity.'<|>'.round($product->order_product_price,(int)$currency->currency_locale).'<|>'.$has_tax;
in the file plugins/hikashoppayment/authorize.php

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 0
12 years 8 months ago #24464

Thanks!

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 0
12 years 8 months ago #24466

We're not getting product code or any product info about the order in our auth.net receipt (I have not made any changes to the authorize.php file). We just get this:
========= GENERAL INFORMATION =========

Merchant : ABC (12345)
Date/Time : 23-Aug-2011 06:46:37 AM

========= ORDER INFORMATION =========
Invoice :
Description :
Amount : 42.00 (USD)
Payment Method : MasterCard
Type : Authorization and Capture

============== RESULTS ==============
Response : This transaction has been approved.
Authorization Code : 012345
Transaction ID : 1234567
Address Verification : Street Address: Match -- First 5 Digits of Zip: Match

==== CUSTOMER BILLING INFORMATION ===
Customer ID :
First Name : John
Last Name : Smith
Company :
Address : 123 Main St.
City : New York
State/Province : New York
Zip/Postal Code : 22222
Country : United States of America
Phone : 555-1212
Fax :
E-Mail : This email address is being protected from spambots. You need JavaScript enabled to view it.

==== CUSTOMER SHIPPING INFORMATION ===
First Name : John
Last Name : Smith
Company :
Address : 123 Main St.
City : New York
State/Province : New York
Zip/Postal Code : 22222
Country : United States of America

======= ADDITIONAL INFORMATION ======
Tax :
Duty :
Freight :
Tax Exempt : Yes
PO Number :

Last edit: 12 years 8 months ago by mrdan.

Please Log in or Create an account to join the conversation.

  • Posts: 81563
  • Thank you received: 13071
  • MODERATOR
12 years 8 months ago #24478

That means that authorize.net doesn't use the detailed information sent by HikaShop. Not much we or you can do in HikaShop unfortunately...

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 0
12 years 7 months ago #24740

ok.
I found this info from authorize.net site about the x_line_item array:
Based on their respective business requirements, merchants can choose to submit itemized order information with a transaction. Itemized order information is not submitted to the processor and is not currently returned with the transaction response. This information is displayed on the Transaction Detail page and in QuickBooks download file reports in the Merchant Interface.

So I decided to add code to get the x_description field to show order info to the authorize.php file:
Added this line: $vars["x_description"]=""; before the loop
Then added this line after $vars["x_line_item"]...:
$vars["x_description"]=$vars["x_description"].'Product Code: '.$product->order_product_code.', Product Name: '.$product->order_product_name.', Quantity: '.$product->order_product_quantity.', Price: '.round($product->order_product_price,(int)$currency->currency_locale).'\r\n';

This code adds product order info to the authorize.net receipt by filling the x_description field. However, the Product Code is not coming through, but rather, the product code is the same as the product name. Is there something I'm doing wrong?

Full code snippet below:

		$vars["x_description"]="";
		$vars["x_line_item"]=array();
		foreach($order->cart->products as $product){
			if(bccomp($product->order_product_tax,0,5)){
				$tax+=$product->order_product_quantity*round($product->order_product_tax,(int)$currency->currency_locale['int_frac_digits']);
				$has_tax = 'TRUE';
			}else{
				$has_tax = 'FALSE';
			}
			$vars["x_line_item"][]=substr($product->order_product_code,0,30).'<|>'.substr(strip_tags($product->order_product_name),0,30).'<|><|>'.$product->order_product_quantity.'<|>'.round($product->order_product_price,(int)$currency->currency_locale['int_frac_digits']).'<|>'.$has_tax;
			$vars["x_description"]=$vars["x_description"].'Course Number: '.$product->order_product_code.', Course Name: '.$product->order_product_name.', How many signups: '.$product->order_product_quantity.', Price: '.round($product->order_product_price,(int)$currency->currency_locale['int_frac_digits']).'\r\n';
		}

Last edit: 10 years 7 months ago by Jerome.

Please Log in or Create an account to join the conversation.

  • Posts: 81563
  • Thank you received: 13071
  • MODERATOR
12 years 7 months ago #24747

Your code is good. I don't see why you wouldn't get the product code in the x_description variable.

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 0
12 years 7 months ago #24852

Ok. I checked and yes it is working. Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 5
  • Thank you received: 0
12 years 7 months ago #25405

I checked this code,it really works great...

Please Log in or Create an account to join the conversation.

  • Posts: 78
  • Thank you received: 1
10 years 7 months ago #124335

Same problem for me, details not supplied on Merchant Email Receipt. Authorize.net says:

If you need the Description details listed in the Merchant Email Receipt, your web developer will need to adjust your website/shopping cart so that Itemized Order Information is no longer being used.

I am trying to implement code from mrdan, he says:

Added this line: $vars["x_description"]=""; before the loop


Where is the loop? Where is this placed?

And...

Then added this line after $vars["x_line_item"]...:


There are 4 of "$vars["x_line_item"]" Which one do I do this after?

Please Log in or Create an account to join the conversation.

  • Posts: 26013
  • Thank you received: 4004
  • MODERATOR
10 years 7 months ago #124401

Hi,

I update the mrdan's post in order to put the "full code" between "code" tags.
With the new version of the plugin (which has changed during these 2 years). It will be

Current code:

		$i = 1;
		$tax = 0;
		$vars["x_line_item"]=array();
		$config =& hikashop_config();
		$group = $config->get('group_options',0);
		foreach($order->cart->products as $product){
			if($group && $product->order_product_option_parent_id) continue;
			if(bccomp($product->order_product_tax,0,5)){
				$tax+=$product->order_product_quantity*round($product->order_product_tax,(int)$this->currency->currency_locale['int_frac_digits']);
				$has_tax = 'TRUE';
			}else{
				$has_tax = 'FALSE';
			}
			$vars["x_line_item"][]=substr($product->order_product_code,0,30).'<|>'.substr(strip_tags($product->order_product_name),0,30).'<|><|>'.$product->order_product_quantity.'<|>'.round($product->order_product_price,(int)$this->currency->currency_locale['int_frac_digits']).'<|>'.$has_tax;
		}

Modified code:
		$i = 1;
		$tax = 0;
		$vars["x_description"]="";
		$vars["x_line_item"]=array();
		$config =& hikashop_config();
		$group = $config->get('group_options',0);
		foreach($order->cart->products as $product){
			if($group && $product->order_product_option_parent_id) continue;
			if(bccomp($product->order_product_tax,0,5)){
				$tax+=$product->order_product_quantity*round($product->order_product_tax,(int)$this->currency->currency_locale['int_frac_digits']);
				$has_tax = 'TRUE';
			}else{
				$has_tax = 'FALSE';
			}
			$vars["x_line_item"][]=substr($product->order_product_code,0,30).'<|>'.substr(strip_tags($product->order_product_name),0,30).'<|><|>'.$product->order_product_quantity.'<|>'.round($product->order_product_price,(int)$this->currency->currency_locale['int_frac_digits']).'<|>'.$has_tax;

			$vars["x_description"] .= 'Course Number: '.$product->order_product_code.', Course Name: '.$product->order_product_name.', How many signups: '.$product->order_product_quantity.', Price: '.round($product->order_product_price,(int)$currency->currency_locale['int_frac_digits']).'\r\n';
		}
Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: adeptdesigns

Please Log in or Create an account to join the conversation.

Time to create page: 0.099 seconds
Powered by Kunena Forum