Payment Gateway not accepting orders

Have a question about how SurfShop™ works? Post it here.

Moderator: frankjan

Post Reply
davewebwalker
Posts: 11
Joined: Mar 20, 2009 6:54 am

Payment Gateway not accepting orders

Post by davewebwalker » Mar 23, 2009 5:51 am

When using a Payment Gateway (Protx UK), I receive an 'Invalid amount format' error message. When I view the source of the confirm page at checkout, there is a tab or spaces in the amount field before the price (see below).
All the other fields are fine and if I create a manual form from the data and remove the spaces before the price the Payment Gateway accepts the order.
This functionality worked perfectly in earlier versions. I have noticed that the same applies if you do a Paypal transaction too.
Since this is going to be our only form of payment it is crucial that we get this working.

Any help would be much appreciated.

<form action="http://www.greenvaleturf.com/cgi-bin/gr ... /protx.cgi" method="POST">
<tr>
<td align=center> <span class="text-body"> Check out
using Protx ™<br>
by clicking the Protx™ button! </span> <br>
<INPUT TYPE="HIDDEN" NAME="Vendor" VALUE="greenvaleturf">
<INPUT TYPE="HIDDEN" NAME="VPSProtocol" VALUE="2.21">
<INPUT TYPE="HIDDEN" NAME="TxType" VALUE="PAYMENT">
<input type="hidden" name="Amount" value=" 75.00"> (tab or spaces appear in value field before price)
<input type="hidden" name="Currency" value="GBP">
<input type="hidden" name="CustomerEmail" value="david.walker@sirius4.co.uk">
<input type="hidden" name="VendorTxCode" value="0000006462">
<input type="hidden" name="Description" value="Greenvale Turf Order">
<input type="hidden" name="FailureURL" value="http://www.greenvaleturf.com/cgi-bin/gr ... =sorry.htm">
<input type="hidden" name="SuccessURL" value="http://www.greenvaleturf.com/cgi-bin/gr ... eceipt.htm">
<input type="image" src="http://techsupport.protx.com/images/pro ... 150_75.gif" name="submit"
alt="Make payments with Protx - it's fast, free and secure!" width="72" height="29" border="0">
</td>
</tr>
</form>

frankjan
Site Admin
Posts: 392
Joined: May 03, 2004 8:57 pm
Contact:

Re: Payment Gateway not accepting orders

Post by frankjan » Mar 23, 2009 9:09 am

This functionality worked perfectly in earlier versions.
Which version were you using before upgrading to 1.4.6a?
<input type="hidden" name="Amount" value=" 75.00"> (tab or spaces appear in value field before price)
This appears to be custom code. What is the field name of the "value" - <! fieldName>?
You can find that code on the Check-Out Options page in the Payment Form box.
Frank Jance
SurfShop Forum Admin

Setting Up Shop Has Never Been Easier!

davewebwalker
Posts: 11
Joined: Mar 20, 2009 6:54 am

Re: Payment Gateway not accepting orders

Post by davewebwalker » Mar 23, 2009 5:07 pm

I was using Pro 1.03 previously.

Yes it is custom code, but the same happens using Surfshop's Paypal function too, the <input type="hidden" name="amount" value="<! chargetotal>"> contains a tab or spaces in the chargetotal value field when the confirm page is generated by Surfshop.
The gateway form looks like this before being processed which is identical to the one I have used in previous versions.

<form action="http://www.greenvaleturf.com/cgi-bin/gr ... /protx.cgi" method="POST">
<tr>
<td align=center> <span class="text-body"> Check out
using Protx ™<br>
by clicking the Protx™ button! </span> <br>
<INPUT TYPE="HIDDEN" NAME="Vendor" VALUE="greenvaleturf">
<INPUT TYPE="HIDDEN" NAME="VPSProtocol" VALUE="2.21">
<INPUT TYPE="HIDDEN" NAME="TxType" VALUE="PAYMENT">
<input type="hidden" name="Amount" value="<! chargetotal>"> (the chargetotal value field is not processing correctly)
<input type="hidden" name="Currency" value="GBP">
<input type="hidden" name="CustomerEmail" value="<! Ecom_BillTo_Online_Email>">
<input type="hidden" name="VendorTxCode" value="<! user_uid>">
<input type="hidden" name="Description" value="<! YourCompany> Order">
<input type="hidden" name="FailureURL" value="<! sspath>?storeid=<! storeid>&ud=<! url:ud>&<! ss_appfield>=<! ss_declined>&c=sorry.htm">
<input type="hidden" name="SuccessURL" value="<! sspath>?storeid=<! storeid>&ud=<! url:ud>&<! ss_appfield>=<! ss_approved>&c=receipt.htm">
<input type="image" src="http://www.greenvaleturf.com/ssimages/store/protx.gif" name="submit"
alt="Make payments with Protx - it's fast, free and secure!" width="185" height="41" border="0">
</td>
</tr>
</form>

davewebwalker
Posts: 11
Joined: Mar 20, 2009 6:54 am

Re: Payment Gateway not accepting orders

Post by davewebwalker » Mar 24, 2009 1:38 am

This is what the source code looks like on the confirm page, you can see the tabs or spaces in the amount value field for the chargetotal which is not formatting correctly.
Image

Please can someone help. we are planning on going live this week and really need this working.

frankjan
Site Admin
Posts: 392
Joined: May 03, 2004 8:57 pm
Contact:

Re: Payment Gateway not accepting orders

Post by frankjan » Mar 24, 2009 8:12 am

We're looking into this and will contact you directly.
Frank Jance
SurfShop Forum Admin

Setting Up Shop Has Never Been Easier!

Nick
Posts: 39
Joined: May 04, 2004 6:20 pm
Contact:

Re: Payment Gateway not accepting orders

Post by Nick » Mar 24, 2009 11:14 am

Dave,

We're using version 1.4.6a ourselves and are not having the problem you mention with Authorize.net. I don't have a solution for you, but I'll bet if you look at the output of <! chargetotal> in your old version, you'll see the same spaces as in the new version. It's the same in our copies.

Regards,
Nick

davewebwalker
Posts: 11
Joined: Mar 20, 2009 6:54 am

Re: Payment Gateway not accepting orders

Post by davewebwalker » Mar 24, 2009 4:37 pm

Hi Nick

I copied the source from the confirm page of the online demo at surfshopcart.com, and as you can see the <! chargetotal> field only contains the price without any spaces.

<form action="https://www.paypal.com/cgi-bin/webscr" method="POST">
<tr>
<td align="center"> <span class="text-body"> Check out
using PayPal® <br>
by clicking the PayPal® button! </span> <br> <input type="hidden" name="cancel_return" value="http://www.surfshopcart.com/cgi-bin/dem ... =sorry.htm">
<input type="hidden" name="business" value="">
<input type="hidden" name="return" value="http://www.surfshopcart.com/cgi-bin/dem ... eceipt.htm">
<input type="hidden" name="amount" value="86.50">
<input type="hidden" name="email" value="david@sirius4.co.uk">
<input type="hidden" name="login_email" value="david@sirius4.co.uk">
<input type="hidden" name="retype_email" value="david@sirius4.co.uk">
<input type="hidden" name="invoice" value="0000005087">
<input type="hidden" name="item_name" value="Pet Fair - Where Pets Rule Order">
<input type="hidden" name="cmd" value="_ext-enter">
<input type="hidden" name="redirect_cmd" value="_xclick">
<input type="image" src="https://www.paypal.com/images/x-click-but1.gif" name="submit"
alt="Make payments with PayPal - it's fast, free and secure!"
width="72" height="29" border="0"> </td>

I have a little knowledge of cgiperl and will look at the ss.lib and shop.cgi files to see if there is anything I can spot that is creating the spaces, any help from anyone on where in the script it writes to the confirm page would be a massive bonus.

frankjan
Site Admin
Posts: 392
Joined: May 03, 2004 8:57 pm
Contact:

Re: Payment Gateway not accepting orders

Post by frankjan » Mar 24, 2009 5:06 pm

Dave,

Try commenting out the following line in the 'moneyfy' subroutine of ss.lib:

Code: Select all

$amt = substr ("            $amt",-12);
Let me know if that corrects your problem.
Frank Jance
SurfShop Forum Admin

Setting Up Shop Has Never Been Easier!

davewebwalker
Posts: 11
Joined: Mar 20, 2009 6:54 am

Re: Payment Gateway not accepting orders

Post by davewebwalker » Mar 25, 2009 1:12 am

Frank, you are a genuis that did the trick. Just tested it and it worked a treat. I had been looking in that area of the ss.lib script myself but was looking at changing the values rather than commenting out.
It may be a good idea to update the latest version with this fix, especially for UK customers.
Thanks again, we can go live now!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest