Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

authorize.net won't display errors


hebert01

Recommended Posts

Hi-

 

I'm a bit of an osC newbie in the process of building my second site with osC. For both sites' payment modules, I've used the default authorize.net payment module included in osC2.2MS2. The first site went forward without a hitch, and authorize.net is functioning quite well. The second one is giving me some grief.

 

My specific problem occurs when processing a credit card number that I know should be declined.

 

When processing the payment using the "to be declined" CC number, and continuing on to the processing page at https://secure.authorize.net/gateway/transact.dll, my first site correctly returns a red box saying "Your credit card was declined. Please try another card or contact your bank for more info."

 

My new site returns no error at all, and simply returns the visitor to the payment information page without displaying any error information whatsoever.

 

To the best of my knowledge, I've done nothing differently in these installs. I've compared the authorizenet.php files on both sites to each other, and they are identical.

 

Can anyone lend a hand, or give me a suggestion as to what files I might investigate to look for the bug? I did search the forum archives, but was unable to find a similar issue.

 

Thanks in advance.

Link to comment
Share on other sites

...anyone?

 

Even if you could give me some suggestions as to which file(s) handle the logic for the generation of these errors, I may be able to troubleshoot it from there. OR, if this topic has been covered before and I've missed it on the archive search, please direct me to a URL.

 

Again, thank you for any help!

Link to comment
Share on other sites

Can ANYONE give some guidance on how to get error messages to print on the checkout screen?

 

The error message is being returned (it shows in the URL) it just does not display on the checkout screen. As a result, the purchaser is just shuffled back to the credit card information entry screen with no explanation as to why they are being sent back.

 

Any help on this would be greatly appreciated.

Thanks!

Link to comment
Share on other sites

The same thing is happening to me...when a declined credit card is used, it brings the customer back to the payment information page without indicating why. No message is being given to tell customer that the card is declined. Does anyone know how to fix this problem?

Thank you

Link to comment
Share on other sites

Make sure that the declined URL is checkout_payment.php - this is the code that outputs the error in that file:

 

<?php
 if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><b><?php echo tep_output_string_protected($error['title']); ?></b></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice">
         <tr class="infoBoxNoticeContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main" width="100%" valign="top"><?php echo tep_output_string_protected($error['error']); ?></td>
               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }
?>

 

Matti

Link to comment
Share on other sites

john- no I don't have the authorizenet curl contribution installed - on both my sites I'm using the preinstalled payment module for authorizenet (one with success, and one not so much).

 

I'm not familiar...can you please explain what the curl contribution adds? the only difficulty I'm having is this one error not displaying (on one site). I've compared my checkout_payment.php files on both sites, and they're identical.

Link to comment
Share on other sites

  • 1 month later...

For everyone who is having the problem that AuthorizeNet is returning error (you can see them in the URL) but the errors are not getting diplayed on the page, I finally found a post that actually addresses the issue and give a step by step on how to correct it.

 

You can view the post HERE

 

This does NOT address any particular error or how to correct errors, it only address the issue of error messages not being displayed on the page.

Link to comment
Share on other sites

  • 1 year later...
  • 4 months later...

Good afternoon,

 

Do you still know the solution ?

 

I'm stuck with some errors only displaying in the URL and not via a pop-up or via the messagestack...

 

Friendly greetings,

 

 

 

For everyone who is having the problem that AuthorizeNet is returning error (you can see them in the URL) but the errors are not getting diplayed on the page, I finally found a post that actually addresses the issue and give a step by step on how to correct it.

 

You can view the post HERE

 

This does NOT address any particular error or how to correct errors, it only address the issue of error messages not being displayed on the page.

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...
Make sure that the declined URL is checkout_payment.php - this is the code that outputs the error in that file:

Where do we find where the declined URL is defined? I can't find that option in the authorizenet settings area.

 

I have search all over the forums and I can not find anywhere how to get the error that is in the URL to be displayed on the page the customer gets returned to when their card is declined for any reason. If the card data is entered correctly and the card is not declined, I get orders to go through fine. Otherwise, when the customer clicks "order confirmation" they get looped back to checkout_payment.php with errors only up in the url!!

 

Any help would be greatly appreciated!!

Much Thanks,

Ashley

Link to comment
Share on other sites

Where do we find where the declined URL is defined? I can't find that option in the authorizenet settings area.

 

I believe what that means is when you get looped back to the payment screen, make sure the URL is checkout_payment.php (in the address bar). Does it look something like "www.yoursite.com/catalog/checkout_payment.php?payment_error=This+is+your+error"?

 

I was having this problem using the standard Authorize.net module that came with oscommerce, but when i went with the contribution of the Authorize.net AIM module, that problem was fixed. Which are you using?

Link to comment
Share on other sites

  • 3 months later...

Has anyone found a solution to this? I'm using the latest Authorize NET AIM package. Here is what I've seen. Using an expired credit card. If I set the expiry date to one in the past I do get the error message ..Credit card error.. the expiry date .... and the url ends with checkout_payment.php?=authorizenet_aim&error=The+expiry+date+entered .......

 

If I use one of the guarenteed to decline cards, set a good expiry date, cvv2 numbers, it will be initially accepted and I'm taken to the checkout_confirmation.php page. Now when I click the confirm order button I'm taken back to the checkout_payment.php page with following url ...

checkout_payment.php?error_message=This%20transaction%20has%20been%20declined%20-%20 .......

 

So it looks like the formatting of the error message is different and because of that will not display properly. Has anyone come up with a fix for this yet? I'm not proficient enough in php to include the code to check for this condition or rewrite the way checkout_confirmation.php returns you back to checkout_payment.php.

 

 

Thanks.

 

PS.. Poor guy. One of my customers today must have entered every credit he had twice trying to buy our product. He had no idea his credit card was declining.

Link to comment
Share on other sites

OK here is a fix for this problem.

 

file is code in catalog/includes/modules/payment/authorizenet_aim.php

 

/

/ If the response code is not 1 (approved) then redirect back to the payment page with the appropriate error message
  if ($x_response_code != '1') {
       tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . $x_response_text . ' - ' . urlencode(MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_DECLINED_MESSAGE), 'SSL', true, false));

 

and replace it with this ...

 

// If the response code is not 1 (approved) then redirect back to the payment page with the appropriate error message
  if ($x_response_code != '1') {
       tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=' . urlencode(MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_DECLINED_MESSAGE), 'SSL', true, false));

 

Now you can go edit the file catalog/includes/languages/english/modules/payment/authorizenet.aim_php

and replace the text in MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_DECLINED_MESSAGE to whatever you want.

 

Hope this helps.

 

Rob

Link to comment
Share on other sites

  • 6 months later...

Oh boy, I've been struggling with this same problem where authorize.net would not display errors for the better part of a day. I thought I'd post MY experience so as to maybe help someone else in the future who has the same problem.

 

* My problems started after I had a server crash (bad blocks on the HD) *

 

I had to re-install the O/S but all my osCommerce files and what-not were fine. Once the O/S was re-installed (without formatting the drive, obviously) everything came back up as expected. osCommerce was working just fine for my site, including SSL and my mail server, and my VoIP server, and all sorts of other custom configuration stuff that I have on my server. Oh, I self-host with commercial cable modem service and static IP address at my house.

 

The only issue I had was that now, nobody could process a payment through osCommerce. The problem manifested itself as first of all, a message from what would have been a customer who said he could not buy my product because the payment screen would just take him back to the checkout confirmation page without processing his payment.

 

Next, I was trying to see if there was a problem and I was having the same issue as in this thread, that I would get returned to the checkout confirmation page without any error message about why the payment was denied.

 

AIM settings were all still correct, I've processed many orders successfully over the last couple of years. It was only after the server crash that orders stopped happening even though everything else seemed to be working just fine.

 

ANYWAY, after many frustrating hours of looking through these threads and digging up obscure documentation for PHP, mySQL, etc. I finally FIGURED IT OUT. I know most everyone here has been through this sort of frustration and then, when you get it work, the immense sense of relief. Whew! :)

 

The solution turned out to be my server hostname. When re-installing the O/S, it asked for a hostname and I just put in the usual server names I always use, which is ex-girlfriends first names. I have Sarah, Kelli, Lisa, etc. as various servers around the house :). Well, of course when using SSL, one must use the PROPER host name, specifically my domain name.

 

Furthermore, after changing the hostname via commandline: "hostname NEW_HOSTNAME" (which is not permanent, by the way), you must ALSO restart your web server.

 

So, the moral of this story is, make sure your hostname is set properly to what authorize.net and your SSL cert are expecting.

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...