Jump to content

joshmorris5

Members
  • Content count

    9
  • Joined

  • Last visited

Profile Information

  • Real Name
    Joshua Morris
  1. From what I can see, you need to put your transaction server to Live. That switch doesn't really work. Chances are you don't have a test account with Authorize.net, therefore you cannot use this module in test mode. Test mode sends it to a different server.

  2. joshmorris5

    authorize.net problems

    Any update on the MD5 Hash? Were you able to get it working?
  3. joshmorris5

    authorize.net problems

    Fix your code with this. Here is the first part of the class constructor code. // class constructor function authorizenet_cc_aim() { global $order; $this->signature = 'authorizenet|authorizenet_cc_aim|1.0|2.2'; $this->code = 'authorizenet_cc_aim'; $this->title = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TEXT_TITLE; $this->public_title = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TEXT_PUBLIC_TITLE; $this->description = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TEXT_DESCRIPTION; $this->sort_order = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_SORT_ORDER; $this->enabled = ((MODULE_PAYMENT_AUTHORIZENET_CC_AIM_STATUS == 'True') ? true : false);
  4. joshmorris5

    authorize.net problems

    I didn't find Authorize.net to be very helpful at all. I contacted their online live support because I was looking at all the setting, and they were correct. I asked her to change the requirements of the info I am supposed to be sending. She told me that they don't have requirements, so it is a problem in the carts script. She said that I needed to contact my provider. She proceeded to mock me when I explained to her that I was using a highly modified open source shopping cart and that I was the provider of that cart, and the script was correct. Frustrated, I ultimately started asking her simple questions about my account which lead her right into my trap. Whatever she did during he research to answer my questions, somehow my account started working. Good times, Good times! Sorry I forgot to include the hash generator last time. http://www.miraclesalad.com/webtools/md5.php I am using OSC v2.2 RC 2a. What version are you using?
  5. joshmorris5

    authorize.net problems

    I would definitely include an MD5 Hash. In fact, here is a free site that will generate one for you. Simply put any string of characters like (password, or p@55w0rD!, or even something as simple as "me") and then click md5. POOF!!! There is your new MD5 Hash. Past the same string on your website and at authorize.net. Should look kinda like this: 3c6e0b8a9c15224a8228b9a98ca1531d Thats all there is to it. I don't know if that will solve your problem though. Check your code to make sure that it is submitting the proper info. If you need help with that, let me know. I'll go into greater detail. Joshua Morris
  6. joshmorris5

    authorize.net problems

    Hey madinchina, Sorry I didn't respond right away. Its the weekend and all..... So what you want to do is add a bit of script to your authorizenet file found here: catalog/includes/modules/payment/authorizenet_cc_aim.php, about line 182 After a script that looks about like so: switch (MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_SERVER) { case 'Live': $gateway_url = 'https://secure.authorize.net/gateway/transact.dll'; break; default: $gateway_url = 'https://test.authorize.net/gateway/transact.dll'; break; } $transaction_response = $this->sendTransactionToGateway($gateway_url, $post_string); if (!empty($transaction_response)) { $regs = preg_split("/,(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/", $transaction_response); Add this script: // begin logging of post variables, authorize.net request, and authorize.net response $myFile = "/home/your-path/file.txt"; $fh = fopen($myFile, 'a') or die("can't open file"); $stringData = "\nSENT: ".$post_string; fwrite($fh, $stringData); $stringData = "\nRESPONSE: ".$transaction_response; fwrite($fh, $stringData); foreach($HTTP_POST_VARS as $key => $value) { $stringData = "\nPOST: $key=$value"; fwrite($fh, $stringData); } fwrite($fh, "\nDone.\n"); fclose($fh); // end logging IMPORTANT!!! In this line... $myFile = "./home/your-path/file.txt"; make sure that you put the correct path. The WHOLE path...NOT JUST "www.mysite.com/catalog..." Its got to include the server path. You can find this information pretty much all over your site, but a quick dirty way to find this path would be on the admin side. Log into your oscommerce administration and on the left side click: Tools > File Manager Up at the top under the heading "File Manager" you will see your full path. While you are in the file manager, create a new file in the path in which you want to store your logs called "file.txt". Use this path to the file. I recommend adding a few folders to try and hide the info a bit. Once you read the file, if you still need it, copy and past it to your local machine, but DO NOT under any circumstances, leave this info on your live server. That is a hackers paradise, and I'd love you to death if you did that for me... **WINK** **WINK** NO...SERIOUSLY!!! DO NOT LEAVE IT THERE! DELETE IT IMMEDIATELY! To read the file all you have to do is type in your web address bar the path and the file like so: http://www.yoursite.com/catalog/path_to_your_file/file.txt REMEMBER!! Once you read it, CLEAR IT! You can easily and quickly do this by using the "File Manger" Once you have fixed your problem, and you are back on line.... you should simply comment out the script like this: /* <script> */ This way, if it ever fails again, you can easily turn the script back on for troubleshooting. You can also leave the file.txt there, just make sure it is blank and the fwrite script is blank. Also, for the record, I am using V1.0. Let me know if this helps you guys. Joshua Morris
  7. joshmorris5

    authorize.net problems

    Ok... I got it to work. Hope this helps everybody. Its not a problem with the script. Don't comment out the script. I was on the Live help with Authorize.net for a couple of hours now. Thurns out you need to make sure that certain fields are not required for your authorization to go through. Go to https://account.authorize.net Click on the following: Under "Account" Click=> Settings Click=>Payment Form Click=>Form Fields You should come to a page that looks like this. Fill it in with your personal settings similar to this. Remember: **If you require it here, and you don't require it in OSCommerce account setup, your customers will recieve an error for those blank fields and payment will be impossible.** With the line of code I put above, you can now require an invoice number. ------------------------------------------------------------------------------------------------------------------------------------------- Payment-Form Fields Field Name--------------------------------------View-------------Edit------------Required Payment Information Recurring Billing Transaction-----------------o-----------------o------------------o Card Code------------------------------------------o-----------------o------------------o Order Information Invoice No---------------------------------------x------------------o------------------x Description--------------------------------------x------------------o------------------x Customer Billing Information First Name--------------------------------------x------------------x------------------x Last Name--------------------------------------x------------------x------------------x Company---------------------------------------x------------------x------------------o Address-----------------------------------------x------------------x------------------x City----------------------------------------------x------------------x------------------x State--------------------------------------------x------------------x------------------x Zip Code----------------------------------------x------------------x------------------x Country-----------------------------------------x------------------x------------------o Phone-------------------------------------------x------------------x------------------o Fax----------------------------------------------x------------------x------------------o Email--------------------------------------------x------------------x------------------x Customer ID-----------------------------------x------------------o------------------x Shipping Information First Name--------------------------------------x------------------x------------------x Last Name--------------------------------------x------------------x------------------x Company---------------------------------------x------------------x------------------o Address-----------------------------------------x------------------x------------------x City----------------------------------------------x------------------x------------------x State--------------------------------------------x------------------x------------------x Zip Code----------------------------------------x------------------x------------------x Country-----------------------------------------x------------------x------------------o Additional Information Tax-----------------------------------------------o-----------------o------------------o Freight-------------------------------------------o-----------------o------------------o Duty----------------------------------------------o-----------------o------------------o Tax Exempt--------------------------------------o-----------------o------------------o PO Number--------------------------------------o-----------------o------------------o ----------------------------------------------------------------------------------------------------------------------------------------------------------------- Let me know if this helps anybody. Joshua Morris
  8. joshmorris5

    authorize.net problems

    For the record, I still don't have it working. I am close though. I got the response that the payment has been authorized and it is routing me to the proper page. However, I still haven't taken Authorize.net live because I still haven't seen any transactions on their site. Well, here's the latest. So I found that even though you are testing, you need to make the "Authorize.net Credit Card AIM" Live. Turns out that in the default settings for osc's authorizenet, "Test" means that you are submitting requests to https://test.authorize.net/gateway/transact.dll. This is the wrong gateway to send it to unless your API login starts with "cpdev" or "cnpdev". The server will return error 13 message (basically wrong username or password). The correct test server if your API login doesn't start with "cpdev" or "cnpdev" is the same as the live server: https://secure.authorize.net/gateway/transact.dll For testing, you need to make sure that Authorize.net is in test mode. To do this, log in to Administration. In the left navigation click on Modules then Payment In the center list, click on Authorize.net Credit Card AIM On the right, you will see the settings. Set them as follows: -------------------------------------------------------------------------------------------------------------------------------------------- Enable Authorize.net Credit Card AIM Do you want to accept Authorize.net Credit Card AIM payments? True * False Login ID xxxxxxxxxx The login ID used for the Authorize.net service Transaction Key xxxxxxxxxxx Transaction key used for encrypting data MD5 Hash xxxxxxxxxxxxxxxxxxxxxxx (same as in authorize.net settings) The MD5 hash value to verify transactions with Transaction Server Perform transactions on the live or test server. The test server should only be used by developers with Authorize.net test accounts. Live * Test Transaction Mode Transaction mode used for processing orders Live * Test Transaction Method The processing method to use for each transaction. Authorization Capture * Payment Zone (personal configuration) If a zone is selected, only enable this payment method for that zone. Set Order Status (personal configuration) Set the status of orders made with this payment module to this value Sort order of display. **Not necessary**(0=first in the list 99=last in the list) Sort order of display. Lowest is displayed first. cURL Program Location The location to the cURL program application. -------------------------------------------------------------------------------------------------------------------------------------------------- After these settings were correct, I was at least getting Authorize.net to correctly identify me, but I was still getting errors. The error I was getting was that it wasn't sending an invoice number. So I added some code. You need to BACKUP!! BACKUP!! BACKUP!! BACKUP!! then find a bit of code in catalog/includes/modules/payment/authorizenet_cc_aim.php that looks like this: function before_process() { global $HTTP_POST_VARS, $customer_id, $order, $sendto, $currency; $params = array('x_login' => substr(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_LOGIN_ID, 0, 20), 'x_tran_key' => substr(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_KEY, 0, 16), 'x_version' => '3.1', 'x_delim_data' => 'TRUE', 'x_delim_char' => ',', 'x_encap_char' => '"', 'x_relay_response' => 'FALSE', 'x_first_name' => substr($order->billing['firstname'], 0, 50), 'x_last_name' => substr($order->billing['lastname'], 0, 50), 'x_company' => substr($order->billing['company'], 0, 50), 'x_address' => substr($order->billing['street_address'], 0, 60), 'x_city' => substr($order->billing['city'], 0, 40), 'x_state' => substr($order->billing['state'], 0, 40), 'x_zip' => substr($order->billing['postcode'], 0, 20), 'x_country' => substr($order->billing['country']['title'], 0, 60), 'x_phone' => substr($order->customer['telephone'], 0, 25), 'x_cust_id' => substr($customer_id, 0, 20), 'x_customer_ip' => tep_get_ip_address(), 'x_email' => substr($order->customer['email_address'], 0, 255), 'x_description' => substr(STORE_NAME, 0, 255), 'x_amount' => substr($this->format_raw($order->info['total']), 0, 15), 'x_currency_code' => substr($currency, 0, 3), 'x_method' => 'CC', 'x_type' => And Replace it with this: function before_process() { global $HTTP_POST_VARS, $customer_id, $invoice_id, $order, $sendto, $currency; $next_inv = ''; $inv_id = tep_db_query("select orders_id from " . TABLE_ORDERS . " order by orders_id DESC limit 1"); $last_inv = tep_db_fetch_array($inv_id); $next_inv = $last_inv['orders_id']+1; $params = array('x_login' => substr(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_LOGIN_ID, 0, 20), 'x_tran_key' => substr(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_KEY, 0, 16), 'x_version' => '3.1', 'x_delim_data' => 'TRUE', 'x_delim_char' => ',', 'x_encap_char' => '"', 'x_relay_response' => 'FALSE', 'x_invoice_num' => substr($next_inv, 0, 20), 'x_first_name' => substr($order->billing['firstname'], 0, 50), 'x_last_name' => substr($order->billing['lastname'], 0, 50), 'x_company' => substr($order->billing['company'], 0, 50), 'x_address' => substr($order->billing['street_address'], 0, 60), 'x_city' => substr($order->billing['city'], 0, 40), 'x_state' => substr($order->billing['state'], 0, 40), 'x_zip' => substr($order->billing['postcode'], 0, 20), 'x_country' => substr($order->billing['country']['title'], 0, 60), 'x_phone' => substr($order->customer['telephone'], 0, 25), 'x_cust_id' => substr($customer_id, 0, 20), 'x_customer_ip' => tep_get_ip_address(), 'x_email' => substr($order->customer['email_address'], 0, 255), 'x_description' => substr(STORE_NAME, 0, 255), 'x_amount' => substr($this->format_raw($order->info['total']), 0, 15), 'x_currency_code' => substr($currency, 0, 3), 'x_method' => 'CC', 'x_type' => Now I am still having trouble with this script because it keeps requiring company. If you customers have a blank field where company is, then it will return a an error. I am still playing with it, but I think if you just comment out that line, it may just pass through without any errors. I realize that commenting it out isn't much of a solution, but if it posts transactions for the time being, I'm all for it. Let me know if you guys can think of anything that might help. Joshua Morris
  9. joshmorris5

    authorize.net problems

  10. joshmorris5

    authorize.net problems

    So I have been searching the forum for weeks now to find a solution to this same problem. I think I am getting closer with "fwrite" script. Here is the log. SENT: x_login=xxxxxxxxx&x_tran_key=xxxxxxxxxxxxxxx&x_version=3.1&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%22&x_relay_response=FALSE&x_first_name=John&x_last_name=Doe&x_company=&x_address=###+Street+Ave.&x_city=Los+Angeles&x_state=California&x_zip=#####&x_country=United+States&x_phone=6265551212&x_cust_id=2&x_customer_ip=XX.XXX.XXX.XX&x_email=johndoe%40my_provider.net&x_description=xxxxxxxxxxxxx&x_amount=3.49&x_currency_code=USD&x_method=CC&x_type=AUTH_CAPTURE&x_card_num=xxxxxxxxxxxxxxxx&x_exp_date=0108&x_card_code=xxx&x_ship_to_first_name=John&x_ship_to_last_name=Doe&x_ship_to_company=&x_ship_to_address=####+Street+Ave.&x_ship_to_city=Los+Angeles&x_ship_to_state=California&x_ship_to_zip=#####&x_ship_to_country=United+States&x_test_request=TRUE&x_freight=2.50&x_line_item=1<|>Test<|>Test<|>1<|>0.99<|>NO RESPONSE: "3","2","13","(TESTMODE) The merchant login ID or password is invalid or the account is inactive.","000000","P","0","","","3.49","","auth_capture","","","","","","","","","","","","","","","","","","","","","","","","","","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","" POST: cc_owner=John Doe POST: cc_number_nh-dns=xxxxxxxxxxxxxxxx POST: cc_expires_month=01 POST: cc_expires_year=08 POST: cc_cvc_nh-dns=xxx POST: x=43 POST: y=6 Done. I think something in the script is not relaying properly. I verified that my login and transaction id were correct, but still nothing. I have tried every possible setting from the admin. I got it to partially work 1 time. Authorize.net shows the transaction, but my site doesn't, nor was I ever routed back to my site. I am gonna play with the code a bit and see if there is maybe a contribution I can add to solve this problem. I really need this to work as do many of us. Joshua Morris
×