Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

STS v4.5 and Error Messages


spbernitt

Recommended Posts

I'm working on a clients site with authorize.net as my credit module. With STS v4.5 installed error messages sent back from authorize do not appear. I need a work around quick. I know it has been discussed in the forums it's just like finding a needle in a haystack.

Link to comment
Share on other sites

I'm working on a clients site with authorize.net as my credit module. With STS v4.5 installed error messages sent back from authorize do not appear. I need a work around quick. I know it has been discussed in the forums it's just like finding a needle in a haystack.

I know two bugs have been resolved with v4.5.2 but neither had anything to do with errors with any of the payment modules. I would suspect something wrong on the payment module end that has nothing to do with STS.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

I know two bugs have been resolved with v4.5.2 but neither had anything to do with errors with any of the payment modules. I would suspect something wrong on the payment module end that has nothing to do with STS.

 

My main concern is getting the error messages that authorize net sends out if it declines a card to show, if I disable the sts module these error messages show. My client wants them enabled so customers know when a card is declined. I really do appreciate your help.

 

Scott

Link to comment
Share on other sites

My main concern is getting the error messages that authorize net sends out if it declines a card to show, if I disable the sts module these error messages show. My client wants them enabled so customers know when a card is declined. I really do appreciate your help.

 

Scott

OK...This STS fix should solve problems with any contribution that is supposed to display error messages during checkout (including Authroize.Net, Discount Coupons, Gift Vouchers,etc.):

 

 

In your catalog/includes/classes/sts.php,

Find this:

	// Add messages before the content
if ($messageStack->size('header') > 0) {
  $this->template['content'] = $messageStack->output('header') . $this->template['content'];
}

 

And Replace it with this:

 

	// Add messages before the content
if ($messageStack->size('header') > 0) {
  $template['content'] = $messageStack->output('header') . $template['content'];
}
////////Start Error Messages - Bill Kellum modified version of Tom Wojcik code for use with STS 4x
if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
$messageStack->add('error_message', $HTTP_GET_VARS['error_message']);
$this->template['content'] =  $messageStack->output('error_message') . $this->template['content'];
}
////// End Error Messages

I really think this will work for you. Please let me know.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

OK...This STS fix should solve problems with any contribution that is supposed to display error messages during checkout (including Authroize.Net, Discount Coupons, Gift Vouchers,etc.):

In your catalog/includes/classes/sts.php,

Find this:

	// Add messages before the content
if ($messageStack->size('header') > 0) {
  $this->template['content'] = $messageStack->output('header') . $this->template['content'];
}

 

And Replace it with this:

 

	// Add messages before the content
if ($messageStack->size('header') > 0) {
  $template['content'] = $messageStack->output('header') . $template['content'];
}
////////Start Error Messages - Bill Kellum modified version of Tom Wojcik code for use with STS 4x
if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
$messageStack->add('error_message', $HTTP_GET_VARS['error_message']);
$this->template['content'] =  $messageStack->output('error_message') . $this->template['content'];
}
////// End Error Messages

I really think this will work for you. Please let me know.

 

 

When authorize.net declines a card I do not get the error message :-(. The code works if the card number is wrong.

 

Scott

Link to comment
Share on other sites

When authorize.net declines a card I do not get the error message :-(. The code works if the card number is wrong.

 

Scott

I suggest posting this in the Authorize.net thread and see if someone over there has a solution for you. If the error messages are coming through, just some of them do not, then it appears that the Authorize.net payment module is using a custom script to pass on error messages for specific scenarios.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

I suggest posting this in the Authorize.net thread and see if someone over there has a solution for you. If the error messages are coming through, just some of them do not, then it appears that the Authorize.net payment module is using a custom script to pass on error messages for specific scenarios.

 

 

Thanks for all your help, I really do appreciate it. Actually, I figured out the issue although it might be a little clumsy. I just followed the code that ya suggested and made another template variable that calls for the specific error. It works.

 

Scott

Link to comment
Share on other sites

Thanks for all your help, I really do appreciate it. Actually, I figured out the issue although it might be a little clumsy. I just followed the code that ya suggested and made another template variable that calls for the specific error. It works.

 

Scott

Scott, exactly what did you do? I would like to make a note of it in case someone else runs into the same issue. Thanks,

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Scott, exactly what did you do? I would like to make a note of it in case someone else runs into the same issue. Thanks,

 

I added this line of code to the general.php

$sts->template['error'] = '<span class="headerError"><b>'. $HTTP_GET_VARS['error_message'].'</span></b>';

 

As you know it makes another item I can add to the templates $error.

 

It was a quick and dirty solution to my issue, I'm sure there are better ways to get it done.

 

Scott

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.
Note: Your post will require moderator approval before it will be visible.

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