Forums / Built-in Shipping and Payment Modules / LinkPoint and Error SGS-005000

LinkPoint and Error SGS-005000

Started by rasyr on 12 Apr 2008, 10:08 PM · Views: 11,949

Results 21 to 36 of 36
18 Apr 2008, 1:58 PM
#21
rasyr avatar

rasyr

Zen Follower

Join Date:
Aug 2006
Posts:
233
Plugin Contributions:
0

LinkPoint and Error SGS-005000

DrByte:

You said:

But, none of any of those fields is greater than 128 characters.
So, I still don't have a "correct" solution for you.

You can try the option I posted earlier to avoid sending any attribute info at all.

What I **THINK **is happening, is that Linkpoint is appending the Option fields to the <description> field (i.e. the product name). Possibly with the field names as well, I am not sure at all.

All that I do know for sure is that they rejecting when multiple options are sent with a product, but that a single option (or no options) pass fine.

I was asking Rasyr that question. The text he posted that you quoted saying there are no fields greater than 120 characters came from his debug log. The information I used when calling Linkpoint was not from the log but from the text in the linkpoint cc review section in admin.

And the text from the CC review page is identical (except for being one big block, rather than the more nicely formatted debug code). If I copy it out and try to format it like the debug code, it basically the same thing.

29 Apr 2008, 4:08 PM
#22
tstamplis avatar

tstamplis

New Zenner

Join Date:
Oct 2006
Posts:
62
Plugin Contributions:
0

Re: LinkPoint and Error SGS-005000

DrByte:

This is the part that's building attributes:```
if (isset($order->products[$i]['attributes'])) {
for ($j=0, $m=sizeof($order->products[$i]['attributes']); $j<$m; $j++) {
$myorder["items"][$num_line_items]['options' . $j]['name'] = $order->products[$i]['attributes'][$j]['option'];
$myorder["items"][$num_line_items]['options' . $j]['value'] = $order->products[$i]['attributes'][$j]['value'];
}
}


Sorry I haven't been back to post, but wanted to add that the above worked perfectly and my transactions now go through without attribute information.  Thanks DrByte!
29 May 2008, 12:46 PM
#23
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: LinkPoint and Error SGS-005000

An update to the linkpoint module has been posted, which handles this attribute length problem automatically ... requiring no manual changes to code:
http://www.zen-cart.com/forum/showthread.php?p=563490#post563490

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

29 May 2008, 9:11 PM
#24
kendur avatar

kendur

New Zenner

Join Date:
Mar 2008
Location:
NW Indiana
Posts:
71
Plugin Contributions:
0

Re: LinkPoint and Error SGS-005000

I just got this same error. The exception is there are no options for this.

Could it be a special character effecting it?

The description that is being sent for this specific item is:

Foldable/flexible Mini Blk Kyb Spill Resistant Great Key Response

65 characters counting spaces.

Ken

29 May 2008, 9:29 PM
#25
tstamplis avatar

tstamplis

New Zenner

Join Date:
Oct 2006
Posts:
62
Plugin Contributions:
0

Re: LinkPoint and Error SGS-005000

kendur:

I just got this same error. The exception is there are no options for this.

Could it be a special character effecting it?

The description that is being sent for this specific item is:

Foldable/flexible Mini Blk Kyb Spill Resistant Great Key Response

65 characters counting spaces.

Ken

Perhaps it is the forward slash in the title. Did you apply Dr. Byte's Fix above? I believe it addresses the characters issue.

29 May 2008, 9:37 PM
#26
kendur avatar

kendur

New Zenner

Join Date:
Mar 2008
Location:
NW Indiana
Posts:
71
Plugin Contributions:
0

Re: LinkPoint and Error SGS-005000

I just applied the patch so we'll see.
He says "commented code can be uncommented for other OT modules such as ot_loworderfee if needed"

I cannot seem to find this commented code and I do use low order fee.

31 May 2008, 8:09 PM
#27
kendur avatar

kendur

New Zenner

Join Date:
Mar 2008
Location:
NW Indiana
Posts:
71
Plugin Contributions:
0

Re: LinkPoint and Error SGS-005000

The patch fixed the error and all is well.
Thanks

Ken

28 Feb 2010, 7:05 PM
#28
outlander avatar

outlander

New Zenner

Join Date:
Dec 2009
Location:
Metro Denver, CO
Posts:
19
Plugin Contributions:
0

Re: LinkPoint and Error SGS-005000

DrByte:

An update to the linkpoint module has been posted, which handles this attribute length problem automatically ... requiring no manual changes to code:
http://www.zen-cart.com/forum/showthread.php?p=563490#post563490

Well, looks Like I need to re-visit this issue as it was showing up on my cart and I just wanted to thank you for making it so easy to fix.

I had already applied the new linkpoint_api.php file and was still getting the problem. Commenting out the portion of code as listed in posting http://www.zen-cart.com/forum/showpost.php?p=549096&postcount=22 was the sure-fire fix to the problem, heck they don't need all that option info anyway.

So thanks again Dr. Byte :clap:

Fred

7 May 2011, 3:04 AM
#29
chrisjaffe avatar

chrisjaffe

New Zenner

Join Date:
Apr 2011
Posts:
2
Plugin Contributions:
0

Re: LinkPoint and Error SGS-005000

outlander:

Well, looks Like I need to re-visit this issue as it was showing up on my cart and I just wanted to thank you for making it so easy to fix.

I had already applied the new linkpoint_api.php file and was still getting the problem. Commenting out the portion of code as listed in posting http://www.zen-cart.com/forum/showpost.php?p=549096&postcount=22 was the sure-fire fix to the problem, heck they don't need all that option info anyway.

So thanks again Dr. Byte :clap:

Fred

I have had this problem this week as well. I am using the latest version of the linkpoint module and I was still getting the error. Commenting out the above code fixed the issue for me too.

Thanks,
cj

6 Jan 2013, 2:34 AM
#30
isaiah36 avatar

isaiah36

Zen Follower

Join Date:
Jun 2006
Posts:
120
Plugin Contributions:
0

Re: LinkPoint and Error SGS-005000

I have version 1.3.9h running, and the code is slightly different in the linkpoint_api.php file:

        if (isset($order->products[$i]['attributes'])) {
          $options_text_length = 0;
          for ($j=0, $m=sizeof($order->products[$i]['attributes']); $j<$m; $j++) {
            $options_text_length += strlen($order->products[$i]['attributes'][$j]['option'] . $order->products[$i]['attributes'][$j]['value']);
          }

This is followed by another block:

          if ($options_text_length < 128) {
            for ($j=0, $m=sizeof($order->products[$i]['attributes']); $j<$m; $j++) {
              $myorder["items"][$num_line_items]['options' . $j]['name'] = substr(htmlentities($order->products[$i]['attributes'][$j]['option'], ENT_QUOTES, 'UTF-8'), 0, 128);
              $myorder["items"][$num_line_items]['options' . $j]['value'] = substr(htmlentities($order->products[$i]['attributes'][$j]['value'], ENT_QUOTES, 'UTF-8'), 0, 128);
            }

Am I correct in deducing only the top block of code needs to be commented out? Or should I comment out the whole block? Sorry, I am a code ignoramus, and I don't want to "try" things with a live install that might interrupt sales.

TIA

9 Jan 2013, 4:36 AM
#31
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: LinkPoint and Error SGS-005000

The code changes posted were for v1.3.8. They are already built-in to v1.3.9.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Jan 2013, 5:44 AM
#32
isaiah36 avatar

isaiah36

Zen Follower

Join Date:
Jun 2006
Posts:
120
Plugin Contributions:
0

Re: LinkPoint and Error SGS-005000

Thanks for the reply, Dr. Byte. We have 1.3.9h running but the SGS errors have showed up precisely following the upgrade from 1.3.7 a little less than a year ago. I tried commenting out the chunk of code, but it resulted in a blank white page after clicking the 'Checkout' link.

11 Jan 2013, 10:08 PM
#33
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: LinkPoint and Error SGS-005000

For v1.3.9h, if you want to skip sending attribute data, remove this block of code: ```
if (isset($order->products[$i]['attributes'])) {
$options_text_length = 0;
for ($j=0, $m=sizeof($order->products[$i]['attributes']); $j<$m; $j++) {
$options_text_length += strlen($order->products[$i]['attributes'][$j]['option'] . $order->products[$i]['attributes'][$j]['value']);
}
if ($options_text_length < 128) {
for ($j=0, $m=sizeof($order->products[$i]['attributes']); $j<$m; $j++) {
$myorder["items"][$num_line_items]['options' . $j]['name'] = substr(htmlentities($order->products[$i]['attributes'][$j]['option'], ENT_QUOTES, 'UTF-8'), 0, 128);
$myorder["items"][$num_line_items]['options' . $j]['value'] = substr(htmlentities($order->products[$i]['attributes'][$j]['value'], ENT_QUOTES, 'UTF-8'), 0, 128);
}
}
}

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Jan 2013, 10:41 PM
#34
isaiah36 avatar

isaiah36

Zen Follower

Join Date:
Jun 2006
Posts:
120
Plugin Contributions:
0

Re: LinkPoint and Error SGS-005000

Thanks for the reply, Dr. Byte. I tried commenting out the whole chunk of code as posted by you. Now I am getting the following on step 3 of the checkout process -

Server error
The website encountered an error while retrieving https://rastaheadwraps.com/index.php?main_page=checkout_payment. It may be down for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

Before there was a blank white page on clicking 'Checkout' whereas now I am getting a 500 error on step 3 of checkout. I am reverting to default code again for now. I appreciate your efforts.

11 Jan 2013, 10:52 PM
#35
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: LinkPoint and Error SGS-005000

Removing the code I quoted won't cause a 500 error. At least, it doesn't for me. And doesn't make sense that it would anyway.
Sounds more like a server error.

In addition to removing that section of code to prevent sending attribute data, you could also make the following change so that the product ID is shorter and doesn't reflect the presence of attributes:```
$myorder["items"][$num_line_items]['id'] = B[/B]$order->products[$i]['id'];

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Jan 2013, 11:07 PM
#36
isaiah36 avatar

isaiah36

Zen Follower

Join Date:
Jun 2006
Posts:
120
Plugin Contributions:
0

Re: LinkPoint and Error SGS-005000

I am so sorry, Dr. Byte. I did not notice the scrollbar at first on your code. I had ended the comment after 1 curly bracket, instead of all 3 curly brackets at the end. Now, with the commenting out being done correctly, the 500 error is not occurring. Checkout process is going through smoothly to 'Confirm Order' step, using the CC method of payment.

All we are waiting for now is to see if the SGS 005000 error stops recurring. I will give it till the end of January and if no further SGS 005000 errors appear I will call it a success! At present, usually about 4-6 sales per week are being blocked by it.

THANK YOU!