Jump to content

Archived

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

Al Brookbanks

Authorize.net AIM Integration

Recommended Posts

Guest skelly77

Can anyone please explain what is meant in transfer.inc.php under the 'Fixed Vars' comment about the country code?

$ccUserData[0]['country']	- Invoice country Id we can look up the country name like this

										countryName($ccUserData[0]['country']);



I would like to see the country ISO instead of the table id on my auth.net invoice but I don't understand what must be done with the supplied info.



Thanks!



skelly77,



have you looked at the file I'm asking about?  I'm also attaching the AIM Guide from Auth.net to this post.  I hope that's ok?

Dibber, I have looked at the file you are asking about and I have read portions of the AIM Guide. I am fairly new to Cube Cart as well as PHP but have had some success in troubleshooting various problems so far. What I think would help both you and me would be a develper's guide that listed the field names for all of the customer /product/shipping/etc. data that is captured in Cube Cart and what the fields are used for. These could then be matched up to the AIM guidelines for customizing the invoices and confirms sent. Does anyone know if such a development guide exists? Scot Kelly Artistream.com
Scot, You didn't mention which version of CC you're using but in 3.0.12 (and I don't know otherwise) the answers to your problem, as I understand it, are /* commented */ at the top of transfer.inc.php which is what I was inquiring about. Here is what my form.inc.php looks like (for delivery details) and it seems to be working without error:

Sorry for the delay in response, I always forget to tick the box to alert me to replies */*

Excellent! I now get the shipping address in my feedback from Authorize.net as well as the customer confirm email. I am using version 3.0.11 by the way. Also in case anyone is confused by how this works, I took the above code and cut and pasted it into the form.inc.php file which is in the "modules\gateway\authorize_aim" directory.

Thanks for your help.

Scot Kelly

Artistream.com

		"x_ship_to_first_name"	=> $basket['delInf']['firstName'],

		"x_ship_to_last_name"	=> $basket['delInf']['lastName'],

		"x_ship_to_address"		=> $basket['delInf']['add_1'].' '.$basket['delInf']['add_2'], // cat because auth.net provides no second address line to my knowledge

		"x_ship_to_city"		=> $basket['delInf']['town'],

		"x_ship_to_state"		=> $basket['delInf']['county'],

		"x_ship_to_zip"			=> $basket['delInf']['postcode'],

		"x_ship_to_country"		=> $basket['delInf']['country'],

Share this post


Link to post
Share on other sites

Guest skelly77

Can anyone please explain what is meant in transfer.inc.php under the 'Fixed Vars' comment about the country code?

$ccUserData[0]['country']	- Invoice country Id we can look up the country name like this

										countryName($ccUserData[0]['country']);

I would like to see the country ISO instead of the table id on my auth.net invoice but I don't understand what must be done with the supplied info.

Thanks!

skelly77,

have you looked at the file I'm asking about? I'm also attaching the AIM Guide from Auth.net to this post. I hope that's ok?

Dibber,

To see the actual country name place the following lines of code in the form.inc.php file:

"x_country" => countryName($ccUserData[0]['country']),

"x_ship_to_country" => countryName($basket['delInf']['country']),

where the first is the invoice address country and the second is the shiping address country. Essentially you are passing the numerical country code into the countryName function which then returns the actual country name in the email from Authorize.net. I have tested this out and it works.

Scot Kelly

Artistream.com

Share this post


Link to post
Share on other sites

I've got everything working with AIM, but at the confirmation page, I get this warning:

Warning: sprintf() [function.sprintf]: Too few arguments in /home/virtual/site15/fst/var/www/html/includes/orderSuccess.inc.php on line 78

Anybody know what could be causing this? I have been up and down every script in CC and all the settings in Authorize.net and can't get it to stop this warning.

Also, in the Authorize.net interface, you set the delimiter to pipe, but it also asks if you want to set encapsulation characters. I set it to none. The confirmation errors if you set anything there. Is this correct?

And one last thing. The emails from the store are pretty bare. They just state the product and amount. Shouldn't it state all the info you relayed to Authorize.net?

I suspect I have something a little wrong somewhere but can't find it. I'm using CC 3.0.14 and some mods.

Thanks for any help.

Share this post


Link to post
Share on other sites

OK, I'm an idiot. I forgot to change the array in the language file when I removed a mod I wrote for the store. The array had too many elements and was messing up the confirmation page and the email. I still would like to know about the encapsulation option on authorize, though.

Share this post


Link to post
Share on other sites
Guest MadTux

And one last thing. The emails from the store are pretty bare. They just state the product and amount. Shouldn't it state all the info you relayed to Authorize.net?

I suspect I have something a little wrong somewhere but can't find it. I'm using CC 3.0.14 and some mods.

Thanks for any help.

This doesn't change the auto-generated store e-mails, but it does modify the information sent to/from Authorize.net in the automagic e-mail receipts.

On my Authorize.net confirmation e-mails, the order number had been showing up as the description, which I felt was kinda wrong, so I made 2 changes in form.inc.php.

I wanted the order number to show up as the Invoice number, and the Description to be the item description.

This is what I did to make it work:

Look for:

 "x_description"				 => $basket['cart_order_id'],



and replace it with: 
"x_description"				 => $orderInv['name'],



and add the following line (wherever you want, in the same section):


 "x_invoice_num"				 => $basket['cart_order_id'],

I haven't tested this yet for multiple items, but I will soon and post a reply to let you know how it works.

Share this post


Link to post
Share on other sites

Nice tweak, thanks. I have a lot of x_ info going out to authorize.net from CC, but that is a handy little adjustment as that "order number as description" thing kind of bothered me too.

Share this post


Link to post
Share on other sites
Guest MadTux

Nice tweak, thanks. I have a lot of x_ info going out to authorize.net from CC, but that is a handy little adjustment as that "order number as description" thing kind of bothered me too.

Thanks :)

I just did some more testing, and discovered that if a client purchases more than 1 item, only the last (second item in cart) is displayed on the Authorize.net e-mail:

========= ORDER INFORMATION =========

Invoice : 061113-004011-4005

Description : Test Product 2

There should be a way to code it so if there are multiple items, each one is appended, as it is in the store e-mail. Unfortunately, I'm not a coder, so I don't know what the syntax would be for that, but I think I can figure it out from the addr1 & addr2 syntax. I'll post a reply if I can get it working.

Share this post


Link to post
Share on other sites
Guest MadTux

There should be a way to code it so if there are multiple items, each one is appended, as it is in the store e-mail. Unfortunately, I'm not a coder, so I don't know what the syntax would be for that, but I think I can figure it out from the addr1 & addr2 syntax. I'll post a reply if I can get it working.

Well, that didn't work.. I tried using the syntax:

$orderInv['name'].' '.$orderInv['name'],

but all that did was show up as "Test Item 2 Test Item 2", which makes sense, since it's just passing the same value twice. I think I'll stop at this point and let someone who knows how to code it work on it, if someone decides to pick it up.

Share this post


Link to post
Share on other sites
Guest

Does CubeCart Version: 3.0.14 still need this for authorize.net AIM to work?

Share this post


Link to post
Share on other sites
Guest

Thanks for the fast reply... I've come to the same conclusion and have successfully moved to Dreamhost where everything works fine.

For anyone reading this, the reason that Godaddy doesn't work is that apparently AIM requires connection on a specific port that Godaddy won't open. Something to possibly check out with a host for those having similar connection issues.

Do you know the port numbers that need to be opened for this? Or does anyone? I am having the same issue and my webhost said they'd open them for me if I could find out what they are! Please help... I need to get this working ASAP because my client REALLY does not like the SIM method of checking out in the cart.

Thanks so much!!

Share this post


Link to post
Share on other sites
Guest

Sorry, I do not know what the port numbers are.

My suggestion would be to contact Authorize.net customer support, in my experience they have been very responsive and no one would know better than they.

Share this post


Link to post
Share on other sites
Guest

Thanks for the advice... I contacted support there, and they provided me with the port numbers (443 if anyone else needs the info)

My host made the switch for me, but unfortunately it didn't help... is there something else that could be causing this issue in debug mode?

Authorize.Net

Advanced Implementation Method (AIM)



Debug Info:

01: Post the transaction (see the code for specific information):

02: Get post results:



03: Parse post results (simple approach)

04: Parse the results string into individual, meaningful segments:

Length of the returned string from Authorize.Net:	0

Number of delimiter characters in the returned string:	0

1: 	



04: Done.

It appears that nothing is getting sent from the form at all... just empty info, even though the form was filled out with test CC info, etc. Any ideas?

Share this post


Link to post
Share on other sites

Not that this has anything to do with the topic at hand, but just FYI...as of April 2007, between restricted PHP functions and stupid cURL proxy servers, using Authorize.net AIM on GoDaddy is completely horked still.

I agonized over the magic PHP string that would let me use the AIM module with GoDaddy's weird CURL proxy setup but I never did figure it out, probably because I am not really a PHP person, but I knew enough to try to take a shot at it. I know it can probably work and may revisit it in the future with some PHP gurus I know, but its broke for now.

My solution was quitting GoDaddy and going to the host advertised at the bottom of these forums. Everything works like clockwork right out of the box now. Just FYI for those beating their heads against the wall in the future with trying to integrate this particular CC payment module with GoDaddy. :w00t:)

Share this post


Link to post
Share on other sites
Guest happyk

Dear Al,

Will the files you have attached fix my problem with Cube Cart 3.0.17? The problems is that the following screen comes up after someone places an order. You cannot press the back button on the browser window to get back to the shopping cart or home page. The customer cannot tell if their order is complete. It doesn't look very professional. I wanted to know if I should upload these files.. if they are the most recent fix and if they would fix this problem. Here is the message. Thank you.

Authorize.Net

Advanced Implementation Method (AIM)

Debug Info:

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

01: Post the transaction (see the code for specific information):

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

02: Get post results:

1|1|1|(TESTMODE) This transaction has been approved.|000000|P|0||091202-044721-4064|25.49|CC|auth_capture||Kim|Carola||389 Old Colchester Rd.|Amston|CT|06231||||||||||||||||||FBAB004A2A1935AC41486D3E6AFD277C|||||||||||

||||||||||||||||||||091202-044721-4064|FALSE||||

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

03: Parse post results (simple approach)

1

1

1

(TESTMODE) This transaction has been approved.

000000

P

0

091202-044721-4064

25.49

CC

auth_capture

Kat

Stevens

321 Ames Rd.

Colchester

CT

06248

FBAB004A2A1935AC41486D3E6AFD277C

091202-044721-4064

FALSE

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

04: Parse the results string into individual, meaningful segments:

Length of the returned string from Authorize.Net: 266

Number of delimiter characters in the returned string: 73

Response Code: Approved

Response Subcode: 1

Response Reason Code: 1

Response Reason Text: (TESTMODE) This transaction has been approved.

Approval Code: 000000

AVS Result Code: P

Transaction ID: 0

Invoice Number (x_invoice_num): NO VALUE RETURNED

Description (x_description): 091202-044721-4064

Amount (x_amount): 25.49

Method (x_method): CC

Transaction Type (x_type): auth_capture

Customer ID (x_cust_id): NO VALUE RETURNED

Cardholder First Name (x_first_name): Kat

Cardholder Last Name (x_last_name): Stevens

Company (x_company): NO VALUE RETURNED

Billing Address (x_address): 321 Ames Rd.

City (x_city): Colchester

State (x_state): CT

ZIP (x_zip): 06248

Country (x_country): NO VALUE RETURNED

Phone (x_phone): NO VALUE RETURNED

Fax (x_fax): NO VALUE RETURNED

E-Mail Address (x_email): NO VALUE RETURNED

Ship to First Name (x_ship_to_first_name): NO VALUE RETURNED

Ship to Last Name (x_ship_to_last_name): NO VALUE RETURNED

Ship to Company (x_ship_to_company): NO VALUE RETURNED

Ship to Address (x_ship_to_address): NO VALUE RETURNED

Ship to City (x_ship_to_city): NO VALUE RETURNED

Ship to State (x_ship_to_state): NO VALUE RETURNED

Ship to ZIP (x_ship_to_zip): NO VALUE RETURNED

Ship to Country (x_ship_to_country): NO VALUE RETURNED

Tax Amount (x_tax): NO VALUE RETURNED

Duty Amount (x_duty): NO VALUE RETURNED

Freight Amount (x_freight): NO VALUE RETURNED

Tax Exempt Flag (x_tax_exempt): NO VALUE RETURNED

PO Number (x_po_num): NO VALUE RETURNED

MD5 Hash: FBAB004A2A1935AC41486D3E6AFD277C

Card Code Response: NO VALUE RETURNED

Reserved (40): NO VALUE RETURNED

Reserved (41): NO VALUE RETURNED

Reserved (42): NO VALUE RETURNED

Reserved (43): NO VALUE RETURNED

Reserved (44): NO VALUE RETURNED

Reserved (45): NO VALUE RETURNED

Reserved (46): NO VALUE RETURNED

Reserved (47): NO VALUE RETURNED

Reserved (48): NO VALUE RETURNED

Reserved (49): NO VALUE RETURNED

Reserved (50): NO VALUE RETURNED

Reserved (51): NO VALUE RETURNED

Reserved (52): NO VALUE RETURNED

Reserved (53): NO VALUE RETURNED

Reserved (54): NO VALUE RETURNED

Reserved (55): NO VALUE RETURNED

Reserved (56): NO VALUE RETURNED

Reserved (57): NO VALUE RETURNED

Reserved (58): NO VALUE RETURNED

Reserved (59): NO VALUE RETURNED

Reserved (60): NO VALUE RETURNED

Reserved (61): NO VALUE RETURNED

Reserved (62): NO VALUE RETURNED

Reserved (63): NO VALUE RETURNED

Reserved (64): NO VALUE RETURNED

Reserved (65): NO VALUE RETURNED

Reserved (66): NO VALUE RETURNED

Reserved (67): NO VALUE RETURNED

Reserved (68): NO VALUE RETURNED

Merchant-defined (69): : 091202-044721-4064

Merchant-defined (70): : FALSE

Merchant-defined (71): : NO VALUE RETURNED

Merchant-defined (72): : NO VALUE RETURNED

Merchant-defined (73): : NO VALUE RETURNED

Merchant-defined (74): :

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

04: Done.

Share this post


Link to post
Share on other sites

×
×
  • Create New...