Hidden fields to Worldpay problem

Problems installing or using the NOP Design Free Shopping Cart. **ARCHIVE** Please post new topics to one of the groups below.

Moderator: scott

Hidden fields to Worldpay problem

Postby makuk » Tue Jan 28, 2003 12:38 pm

Hi

Just found this awesome shopping cart and have been messing with it, I have a problem, in that I use World Pay, the script sends over all the correct information except for what they have ordered, ie:

ID_NUM, PRICE etc etc

I haven't modified this information in the script, and I have added this infp to my worldpay configurations, however, it just doesn't appear.

Does anyone else use worldpay and know what the problem is or does anyone else just know what the problem is. Your help is appreciated.

Regards

Mark.
makuk
 
Posts: 21
Joined: Tue Jan 28, 2003 12:34 pm

Postby PsychoPaint » Tue Jan 28, 2003 3:56 pm

I have just set up a cart linked to WorldPay and had the same problem.
Cured it by putting the product description in hidden text field 'NAME'.

<input type=hidden name=NAME value="Product description">
PsychoPaint
 
Posts: 1
Joined: Tue Jan 28, 2003 3:48 pm

Already have that

Postby makuk » Tue Jan 28, 2003 4:27 pm

Hi thanks for your reply, but I already have that:

<FORM NAME=order ACTION="managecart.html" onSubmit="AddToCart(this);">
<input type=hidden name="PRICE" value="11.95">
<input type=hidden name="NAME" value="My Product">
<input type=hidden name=ID_NUM value="0182">
<input type=hidden name=SHIPPING value="0.00">
<input type=hidden name="QUANTITY" value="1">
<TR><TD ALIGN = "center" width=25%>
<input type="image" SRC="images/addtcart.gif" height="23" width="78" BORDER=0 ALT="Add item to cart."></TD></form>

This submits to the checkout fine and it submits the vale of the checkout to Worldpay etc but just doesn't send me all the products etc that have been ordered.

Anyone else now why this doesn't happen.

Thanks

Mark.
makuk
 
Posts: 21
Joined: Tue Jan 28, 2003 12:34 pm

Postby Steven Nyland » Tue Jan 28, 2003 6:44 pm

Makuk,

I am not quite sure what you mean, but the NOPCart script should pass the following to WS:

Product ID, Product Name, Quantity, Total price

If you look at the checkoutcart function in nopcart.js, you'll see the snipplet:

Code: Select all
      if ( PaymentProcessor != '' ) {
         //Process description field for payment processors instead of hidden values.
         //Format Description of product as:
         // ID, Name, Qty X
         strPP += fields[0] + ", " + fields[3];
         if ( fields[5] != "" )
            strPP += " - " + fields[5];
         strPP += ", Qty. " + fields[1] + "\n";


Though, I must admit that I cannot explain the line return (\n). Perhaps Scott can inform us about that one.

Steven
[ If it ain't Dutch ... it ain't Much ]
Steven Nyland
Guru
 
Posts: 274
Joined: Thu Jan 02, 2003 1:20 pm
Location: Still here ...

true or false

Postby makuk » Tue Jan 28, 2003 11:31 pm

At the top of the script it says:

HiddenFieldsToCheckout = true;

or should it be false if I am sending to Worldpay

Thanks

Mark.
makuk
 
Posts: 21
Joined: Tue Jan 28, 2003 12:34 pm

Postby Steven Nyland » Tue Jan 28, 2003 11:40 pm

No, it should be set to true else the cart does not pass anything to payment vendors.
[ If it ain't Dutch ... it ain't Much ]
Steven Nyland
Guru
 
Posts: 274
Joined: Thu Jan 02, 2003 1:20 pm
Location: Still here ...

Postby makuk » Tue Jan 28, 2003 11:46 pm

No

Worldpay is receiving nothing, all it receives is the total of the cart, it does not send me any item number etc

This is what I use to send a product to the cart:

<FORM NAME=order ACTION="../../managecart.html" onSubmit="AddToCart(this);">
<input type="image" SRC="../../images/addtcart1.gif" height="20">
<input type=hidden name="QUANTITY" value="1">
<input type=hidden name="PRICE" value="18.95">
<input type=hidden name="NAME" value="Dolphin">
<input type=hidden name=ID_NUM value="2345">
<input type=hidden name=SHIPPING value="0.00">
</form>

So out of curiousity what would the hidden values be that it sends to worldpay, are they:

QUANTITY_1 or QUANTITY1 etc etc
PRICE_1 or PRICE1 etc etc

I haven't modified the script in anyway, thought I would get it working properly first.

I also noticed that if you view the source of the checkout page, it does not show the items or the hidden values it sends over.

Any help to get this sorted would be great

Thanks

Mark.
makuk
 
Posts: 21
Joined: Tue Jan 28, 2003 12:34 pm

Postby Steven Nyland » Wed Jan 29, 2003 12:08 am

Pls post the <form> on your checkout page -or- better even, please post the url of your checkout page.

Also, do you have the set-up information/conditions from Worldpay?
(they usually require hidden fields to be passed on)

Steven
[ If it ain't Dutch ... it ain't Much ]
Steven Nyland
Guru
 
Posts: 274
Joined: Thu Jan 02, 2003 1:20 pm
Location: Still here ...

Postby makuk » Wed Jan 29, 2003 12:19 am

Hi

I haven't uploaded it yet, working on it from the pc, I already have a site where I want to use this cart, but it is cgi based and causing a few problems for AOL browers so I need to change it quick.

I have told worldpay to pass all the variables across to me that i think they could be ie: cost1 and cost_1 etc etc, here's the checkout.htm page:

It sends over the variables to worldpay for the other hidden fields ie: name address etc.

Thanks for your help:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style>
<!--
body { scrollbar-face-color: #B5A5D6; scrollbar-shadow-color: #EFEFEF; scrollbar-highlight-color: #EFEFEF;
scrollbar-3dlight-color: #B5A5D6; scrollbar-darkshadow-color: #A57BCE; scrollbar-track-color: #A57BCE;
scrollbar-arrow-color: #EFEFEF}
//-->
</style>
<STYLE TYPE="text/css">
<!--
A {text-decoration: none}
-->
</STYLE>
<SCRIPT SRC="language-en.js"></SCRIPT>
<SCRIPT SRC="nopcart.js">
</SCRIPT>
<SCRIPT>
function CheckForm( theform )
{
var bMissingFields = false;
var strFields = "";

if( theform.name.value == '' ){
bMissingFields = true;
strFields += " Billing: Full name\n";
}
if( theform.b_last.value == '' ){
bMissingFields = true;
strFields += " Billing: Last Name\n";
}
if( theform.b_addr.value == '' ){
bMissingFields = true;
strFields += " Billing: Address\n";
}
if( theform.b_city.value == '' ){
bMissingFields = true;
strFields += " Billing: City\n";
}
if( theform.b_state.value == '' ){
bMissingFields = true;
strFields += " Billing: State\n";
}
if( theform.b_zip.value == '' ){
bMissingFields = true;
strFields += " Billing: Zipcode\n";
}
if( theform.b_phone.value == '' ){
bMissingFields = true;
strFields += " Billing: Phone\n";
}
if( theform.b_email.value == '' ){
bMissingFields = true;
strFields += " Billing: Email\n";
}

if( bMissingFields ) {
alert( "I'm sorry, but you must provide the following field(s) before continuing:\n" + strFields );
return false;
}

return true;
}
</SCRIPT>
</head>
<BODY TEXT=#696969 BGCOLOR=#FFFFFF LINK=#8C5AA5 VLINK=#8C5AA5 ALINK=#8C5AA5>
<FORM METHOD='POST' ACTION='https://select.worldpay.com/wcc/transaction'>
<input type=hidden name=instId value=*****>
<input type=hidden name=testMode value=100>
<input type=hidden name=currency value=GBP>
<input type=hidden name=cartId value=SexCraft>
<input type=hidden name=desc value=Products.>
<input type=hidden name=M_recipient value=sales@sexcraft.co.uk>
<input type=hidden name=M_subject value="URGENT ORDER FROM WEB SITE">

<blockquote>

<NOSCRIPT>
Whoops, we detected that your browser does not have JavaScript, or it is disabled. Our product catalog requires that you
have JavaScript enabled to order products. <a href="http://www.netscape.com">Netscape</a> and <a href="http://www.microsoft.com/ie">Microsoft</a>
offer free browsers which support JavaScript. If you are using a JavaScript compliant browser and still have problems, make sure you
have JavaScript enabled in your browser's preferences.</NOSCRIPT>
<FONT CLASS="checkout">
<form action="cgi-bin/checkout.pl" method="POST" onSubmit="return CheckForm(this)">
<NOBR>
<SCRIPT>
CheckoutCart();
</SCRIPT>
</NOBR>


<table border=0 cellpadding=0 cellspacing=0 width=539 height="1549">
<tr><td height="1549">
<TABLE WIDTH=539 BORDER=0 BGCOLOR=#FFFFFF>


<tr>
<TD align=left colspan=2><FONT SIZE=2 face=verdana>
</font><b><font color=#128C8B face=verdana>Personal information</font><FONT SIZE=2 face=verdana><br>
</font></b><font size=2 face=verdana>Please complete your personal information below accurately,
this is the information we will use to contact you should there be a problem with your order.</font><br><br></TD>
</tr>

<TR><TD align=left><B><font color=#8C5AA5 size=2 face=verdana>Your IP address:</font></B></TD><TD><B><font size=2 face=verdana>213.208.103.163</font></B>

<TR><TD align=left><B><font color=#8C5AA5 size=2 face=verdana>Full name:</font></B></TD><TD>
<INPUT NAME=name SIZE=30 MAXLENGTH=30>

<TR><TD align=left><B><font color=#8C5AA5 size=2 face=verdana>E-mail address:</font></B></TD><TD>
<INPUT NAME=email SIZE=30>

<TR><TD align=left valign=top><B><font color=#8C5AA5 size=2 face=verdana>Address:</font><BR></B></TD>
<TD><textarea rows=5 name=address cols=23></textarea>

<tr><TD align=left><B><font color=#8C5AA5 size=2 face=verdana>Postcode:</font></B></TD><TD>
<INPUT NAME=postcode SIZE=30><BR>

<TR><TD align=left valign=top><B><font color=#8C5AA5 size=2 face=verdana>Country:</font><BR></B></TD>
<TD>
<select NAME=country>
<option value=GB selected>United Kingdom
<option value=AT >Austria
<option value=BE >Belgium
<option value=CY >Cyprus
<option value=DK >Denmark
<option value=FI >Finland
<option value=FR >France
<option value=DE >Germany
<option value=GI >Gibraltar
<option value=GR >Greece
<option value=HU >Hungary
<option value=IS >Iceland
<option value=IE >Ireland
<option value=IT >Italy
<option value=LU >Luxembourg
<option value=MT >Malta
<option value=MC >Monaco
<option value=NL >Netherlands
<option value=NO >Norway
<option value=PL >Poland
<option value=PT >Portugal
<option value=SM >San Marino
<option value=ES >Spain
<option value=SE >Sweden
<option value=CH >Switzerland
<option value=TR >Turkey
<option value=GB >United Kingdom
</select></TD></TR>

<TR><TD><font color=#8C5AA5 size=2 face=verdana><B>Tel number:</B><BR><font size=1 face=verdana>Mobile numbers accepted.</font></font></TD><TD>
<INPUT NAME=tel SIZE=30>
</TD></TR><BR>

<TR><TD><font color=#8C5AA5 size=2 face=verdana><B>Fax number:</B><BR></font></TD><TD>
<INPUT NAME=fax SIZE=30>
</TD></TR><BR>
<tr>
<TD align=left colspan=2><br>
<b><font color=#128C8B face=verdana>Delivery</font></b><br>
<font size=2 face=verdana>If you would like your goods delivered to an address other than that
shown above, please enter the details below, otherwise, please leave blank.</FONT><b><br>
&nbsp;</b></TD>
</tr>
<tr>
<tr><TD align=left><B><font color=#8C5AA5 size=2 face=verdana>Full name:</font></B></TD><TD>
<INPUT NAME=M_delivername SIZE=30 MAXLENGTH=30>

<tr><TD align=left valign=top><B><font color=#8C5AA5 size=2 face=verdana>Address:</font><BR></B></TD>
<TD><textarea rows=5 name=M_deliveraddress cols=23></textarea>

<tr><TD align=left><B><font color=#8C5AA5 size=2 face=verdana>Postcode:</font></B></TD><TD>
<INPUT NAME=M_deliverpostcode SIZE=30><BR>

<TR><TD align=left valign=top><B><font color=#8C5AA5 size=2 face=verdana>Country:</font><BR></B></TD>
<TD>
<select NAME=M_delivercountry>
<option value=GB selected>United Kingdom
<option value=AT >Austria
<option value=BE >Belgium
<option value=CY >Cyprus
<option value=DK >Denmark
<option value=FI >Finland
<option value=FR >France
<option value=DE >Germany
<option value=GI >Gibraltar
<option value=GR >Greece
<option value=HU >Hungary
<option value=IS >Iceland
<option value=IE >Ireland
<option value=IT >Italy
<option value=LU >Luxembourg
<option value=MT >Malta
<option value=MC >Monaco
<option value=NL >Netherlands
<option value=NO >Norway
<option value=PL >Poland
<option value=PT >Portugal
<option value=SM >San Marino
<option value=ES >Spain
<option value=SE >Sweden
<option value=CH >Switzerland
<option value=TR >Turkey
<option value=GB >United Kingdom
</select></TD></TR>
<TD align=left colspan=2><br>
<b><font color=#128C8B face=verdana>FREE gift wrapping and gift tag.</font><br>
</b><font size=2 face=verdana>Please tick the box if you would like your products gift wrapped </font>
<input type=checkbox name=M_giftwrap value=ON><BR>
<B><font size=2 face=verdana color=#8C5AA5></font></B><BR>
</TD></tr>
<tr>
<TD align=left valign=top><font color=#8C5AA5 size=2 face=verdana><b>Gift tag message:</font></b><BR>
<font size=2 face=verdana>Please enter here exactly what you would like written in your gift tag.</font><br><br>
<font size=1 face=verdana>Maximum 30 words and please check your spelling .</font></TD><TD>
<textarea rows=5 name=M_giftmessage cols=23></textarea>
</tr>
<tr>
<TD align=left colspan=2><br>
<b><font color=#128C8B face=verdana>Questions/Comments</font><br>
</b><font size=2 face=verdana>Is there anything you would like to ask or tell us?</font><BR><BR>
</TD></tr>
<tr>
<TD align=left valign=top><font color=#8C5AA5 size=2 face=verdana><b>Questions/Comments:</b></font></TD><TD>
<textarea rows=5 name=M_questions cols=23></textarea>
</tr>
<tr>
<TD align=left colspan=2><br>
<b><font color=#128C8B face=verdana>Promotional code</font><br>
</b><font size=2 face=verdana>If you have a promotional code, please enter it in the box below.</font><BR><BR>
</TD></tr>
<tr>
<TD align=left valign=top><font color=#8C5AA5 size=2 face=verdana><b>Promotional code:</b></font></TD><TD>
<input name=M_promotion size=30></textarea>
</tr>
<tr>
<TD align=left colspan=2><font face=Verdana color=#128C8B><b><br>
How did you find us?<br>
</b></font><font size=2 face=Verdana>Would you be so kind as to tell us how
you found our store.<br>
&nbsp;</font><table border=0 cellpadding=0 cellspacing=0 bordercolor=#111111 width=533>
<tr>
<TD align=left valign=top width=238><b>
<font face=verdana size=2 color=#8C5AA5>I came from:</font><BR></b></TD>
<TD width=301>
<select NAME=M_from>
<option value=XX selected>I Can't remember
<option value=existing >Existing customer
<option value=2020 >2020 Shops
<option value=aol >AOL search
<option value=altavista >Altavista search
<option value=bluewave >Blue Wave
<option value=buybypost >Buy by Post
<option value=comeshopping >Come Shopping
<option value=condom >Condom Biz
<option value=ebay >Ebay
<option value=ebid >Ebid
<option value=excite >Excite search
<option value=gaytoz >Gay to Z
<option value=gbp >Great British Pages
<option value=google >Google search
<option value=hush >Hush-Hush
<option value=istore >I-Stores
<option value=localswingers >Local Swingers
<option value=msn >MSN search
<option value=news >Newsgroups
<option value=scrub >Scrub the web
<option value=shop >Shop
<option value=singles >Singles Stop
<option value=splut >Splut
<option value=jockey >Spot Jockey
<option value=total >Total Shopper
<option value=ukshop >UK Shop Online
<option value=webspot >Web Spotting
<option value=yahoo >Yahoo search
<option value=othersite >Other site
<option value=othersearch >Other search engine
<option value=other >Other
</select></TD>
</tr>
</table>
</td>
</tr>
</table>

<br><b><font color=#128C8B face=verdana>Substitution</font></b>
<br><font size=2 face=verdana>
Unlike other adult stores, we understand that you want your goods as soon
as possible, and in the unlikely event that we do not have stock of any
item you have ordered, we will substitute (with your permission) the out of
stock item for a similar more expensive item at no extra charge to yourself.
<BR><BR>
Please tick the box below to confirm that you are happy for us to substitute your item. Should you not tick the box, we will inform you by return of any out of stock items
with the expected delivery date.</font><BR><BR>
<font size=2 face=verdana color=#8C5AA5>Please tick the box to allow us to substitute out of stock items </font>
<input type=checkbox name=M_substitute value=ON>
<BR>
<br><b><font color=#128C8B face=verdana>FREE gift</font></b>
<br><font size=2 face=verdana>
if you have spent over £30 or £100 you will receive a free gift, just tick the relevant box below for your free gift.</font><BR><BR>
<font face=Verdana size=2 color=#696969>I would like the free <b>male</b> gift </font><input type=checkbox name=M_male value=male><BR>
<font face=Verdana size=2 color=#696969>I would like the free <b>female</b> gift </font><input type=checkbox name=M_female value=female>
</tr>
</TABLE>

<BR>&nbsp;&nbsp;&nbsp;<table border=0 cellpadding=0 cellspacing=0 bordercolor=#111111 width=387 align="left">
<tr>
<td width=517>
<p align=center><INPUT TYPE=SUBMIT VALUE="Continue to secure area"><BR><BR><input type=reset value="Reset form">
<br>
<br>
&nbsp;</td>
</tr>
</table>
</td></tr></table></form>
</body></html>
makuk
 
Posts: 21
Joined: Tue Jan 28, 2003 12:34 pm

Postby Steven Nyland » Wed Jan 29, 2003 1:06 am

You have two different forms on your page. One that submits to Worldpay and one that submits to your checkout.pl. The forms are nested as you have only one closing tag on your page. As far as I know, nested forms don't function properly. On submitting only one form action will be executed.

Use ONE form that either submits to the checkout.pl script OR to Worldpay. The checkout.pl script should direct the customer to a 2nd checkout form (with only a button) that executes the WP payment process.
If you search the forum, a user already implemented such a MOD for use with PayPal.

Hope this helps,

Steven

P.s. you can mail my FREE GIFT to : (-censored-) :lol:
[ If it ain't Dutch ... it ain't Much ]
Steven Nyland
Guru
 
Posts: 274
Joined: Thu Jan 02, 2003 1:20 pm
Location: Still here ...

I REMOVED

Postby makuk » Wed Jan 29, 2003 2:15 am

Hi

I removed the checkout.pl form, and that made no difference, still does not submit the data, could you tell me please what are the variables that are sent across please, are they:

PRICE_1
ITEM_1

etc etc

Thanks

Mark
makuk
 
Posts: 21
Joined: Tue Jan 28, 2003 12:34 pm

Postby makuk » Wed Jan 29, 2003 2:33 am

Can someone tell me where in the script it sneds the details to worldpay, if I can find this, I can place M_ in fron tof it and the voila! I should be there.

Thanks

Mark.
makuk
 
Posts: 21
Joined: Tue Jan 28, 2003 12:34 pm

Postby makuk » Wed Jan 29, 2003 11:53 pm

makuk
 
Posts: 21
Joined: Tue Jan 28, 2003 12:34 pm

This is how it is done.

Postby makuk » Thu Jan 30, 2003 1:21 am

makuk
 
Posts: 21
Joined: Tue Jan 28, 2003 12:34 pm


Return to Installation and Setup Problems

Who is online

Users browsing this forum: No registered users and 0 guests

cron