close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Error on redirect page to PayPal

Thread began 1/07/2014 12:19 am by Fritz Stickers | Last modified 1/09/2014 11:42 am by Jason Byrnes | 2641 views | 11 replies |

Fritz Stickers

Error on redirect page to PayPal

When choosing to pay with PayPal, customers come first on a redirect-page (see attach) while waiting.
But some customers get an error while redirecting to PayPal.
They are using Windows 8(.1).

Is it in my code or what can be the culprit ?


Best Regards,
Geert.

Sign in to reply to this post

Jason ByrnesWebAssist

What is the error?

Impossible to know the cause of an error without knowing what the error says....

Sign in to reply to this post

Fritz Stickers

The only thing I know about the error, is the snapshot a customer mailed me.
The "Redirect-error.jpg" is in the attached zip :
"500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed."

Sign in to reply to this post

Jason ByrnesWebAssist

error 500 is a generic error.

it used to mask the real error from site visitors.

We need to know what the actual error message is. your host should have an error log file that records the real message when showing the generic one on the screen

once we know the real message, we can start to determine the cause.

Sign in to reply to this post

Fritz Stickers

Hi Jason,

I found this error 500 in the log file :

2014-01-05 22:39:23 POST /Redirect.asp |989|80040e14|Number_of_query_values_and_destination_fields_are_not_the_same. - 178.118.226.183 HTTP/1.1 Mozilla/5.0+(Windows+NT+6.3;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/31.0.1650.63+Safari/537.36 http://www.stickers.be/Checkout_PayPal.asp 500 1404

Sign in to reply to this post

Jason ByrnesWebAssist

This is probably caused by the information being saved to the order or order details tables.

since it happens to some orders and not others, it is probably specific product information coming from the cart. Find out what products they ordering when the problem occurs, then look at the information that gets saved to the cart by the add to cart buttons for those products.

I would guess that there are special characters such as a single or double quote being saved to the cart, or a text value is being saved to the cart, but it is being passed to the orders / order details table as numeric

Sign in to reply to this post

Fritz Stickers

The culprit is the "vertical bar" character (|).
Customers can order a text (decal). This was his tekst : Goethals J.|O+ "Shadownight #771"
So I tried it for my own and I had also the error 500.

In the "eCart Store Details in Database", the product "cStr(WA_eCart_DisplayInfo(stickersBE, "EigenTekst"))" is stored as text.

<%' WA eCart Store Cart Details in Db
if ("" = "") then
WA_connection = MM_connstickersBE_STRING
WA_table = "tblOrderDetails"
WA_redirectURL = ""
WA_indexField = "OrderID"
WA_fieldNamesStr = "OrderID|ProductID|ProductName|MirrorImage|ProductSize|ProductColor|EigenTekst|Font|StandaardPrijs|AangepastePrijs|Aantal|Total|AanboordTekst"
WA_fieldValuesStr = WA_eCDB_ConvertNumber("" & cStr( Session("OrderNumber") ) & "") & "|" & WA_eCDB_ConvertNumber("" & cStr(WA_eCart_DisplayInfo(stickersBE, "ID")) & "") & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "Name")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "MirrorImage")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "Size")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "Color")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "EigenTekst")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "Font")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "Price")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "TruePrice")) & "" & "|" & WA_eCDB_ConvertNumber("" & cStr(WA_eCart_DisplayInfo(stickersBE, "Quantity")) & "") & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "TotalPrice")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "AanboordTekst")) & ""
WA_columnTypesStr = "none,none,NULL|none,none,NULL|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|none,none,NULL|',none,''|',none,''"
indexFieldIndex = -1
WA_fieldValues = Split(WA_fieldValuesStr,"|")
if (WA_redirectURL <> "" AND Request.QueryString <> "" AND Request.QueryString.Count > 0) then
if (inStr(WA_redirectURL,"?") > 0) then
WA_redirectURL = WA_redirectURL & "&"
else
WA_redirectURL = WA_redirectURL & "?"
end if
WA_redirectURL = WA_redirectURL & Request.QueryString
end if
WA_cmdObjString = "ADODB.Command"
set WA_editCmd = Server.CreateObject(WA_cmdObjString)
WA_editCmd.ActiveConnection = WA_connection
WA_fieldNames = Split(WA_fieldNamesStr,"|")
WA_columns = Split(WA_columnTypesStr,"|")
for i = 0 to Ubound(WA_fieldNames)
if (WA_indexField = WA_fieldNames(i)) then
indexFieldIndex = i
exit for
end if
next
deleteFieldValue = cStr(WA_fieldValues(indexFieldIndex))
if (deleteFieldValue <> "" AND deleteFieldValue <> "undefined") then
deleteParamsObj = WA_generateInsertParams(Array(WA_indexField), Array(WA_columns(indexFieldIndex)), Array(deleteFieldValue), -1)
WA_editCmd.CommandText = "Delete from " & WA_table & " where " & WA_indexField & " = " & deleteParamsObj(2)
WA_editCmd.Execute()
end if
set stickersBE = WA_eCart_MoveFirst(stickersBE)
while (NOT WA_eCart_EOF(stickersBE))
WA_fieldValuesStr = WA_eCDB_ConvertNumber("" & cStr( Session("OrderNumber") ) & "") & "|" & WA_eCDB_ConvertNumber("" & cStr(WA_eCart_DisplayInfo(stickersBE, "ID")) & "") & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "Name")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "MirrorImage")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "Size")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "Color")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "EigenTekst")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "Font")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "Price")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "TruePrice")) & "" & "|" & WA_eCDB_ConvertNumber("" & cStr(WA_eCart_DisplayInfo(stickersBE, "Quantity")) & "") & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "TotalPrice")) & "" & "|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "AanboordTekst")) & ""
WA_fieldValues = Split(WA_fieldValuesStr,"|")
insertParamsObj = WA_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1)
WA_editCmd.CommandText = "insert into " & WA_table & " (" & insertParamsObj(1) & ") values (" & insertParamsObj(2) & ")"
WA_editCmd.Execute()
set stickersBE = WA_eCart_MoveNext(stickersBE)
wend
set stickersBE = WA_eCart_MoveFirst(stickersBE)
WA_editCmd.ActiveConnection.Close()
if (WA_redirectURL <> "") then
Response.Redirect(WA_redirectURL)
end if
end if
%>
Sign in to reply to this post

Jason ByrnesWebAssist

the vert bar character will need to be converted to HTML entity.

i dont remember the ASP syntax for this, but in PHP it is:

str_replace("|", "&#124;",$value);

where $value is the string that contains the pipe character.

Sign in to reply to this post

Fritz Stickers

this is in AS VBScript :

<%  
Dim myString
myString = "|"
' vbscript replace specified with 3 required parameters such as string expression, find string and replacement string value
Response.Write(Replace(myString, "|", "&#124;"))
%>



But where do I have to place it ?

Sign in to reply to this post

Jason ByrnesWebAssist

in the code for the store details:

change:
"|" & "" & cStr(WA_eCart_DisplayInfo(stickersBE, "EigenTekst")) & "" & "|"

to:
"|" & "" & cStr(Replace(WA_eCart_DisplayInfo(stickersBE, "EigenTekst"), "|", "&#124;")) & "" & "|"

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...