close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Sage Pay not working in ECart 6

Thread began 7/22/2014 8:10 am by daniel279790 | Last modified 7/31/2014 6:21 pm by Jason Byrnes | 995 views | 15 replies |

daniel279790

Sage Pay not working in ECart 6

Hi there
I've been using Ecart 4 happily for a few years now (currently in CSS6 on a Mac), but a client has recently decided to change from PayPal to SagePay. I used to use a simple form connection from Ecart to PayPal and wanted to do the same with Sage Pay but I had big problems getting this to work and after speaking to someone at Sage Pay customer support they suggested that it might be because Ecart 4 was set up for ProtX, (old Sage Pay) and I needed to upgrade to Ecart 6 as Sage Pay are stopping all support for ProtX in the next 12 months.

So I’ve finally upgraded to Ecart 6 and set up a test folder to try and get the cart to connect to Sage Pay via the checkout form. But I’m still hitting various problems and so wondered if you guys could possibly help me?

Using the basic Checkout Wizard I’ve selected Sage Pay and its created the necessary files (confirm.php, checkout.php etc etc).

The form on the checkout page points to…
<form class="NewFromBlank_Default" id="Payment_NewFromBlank_Default" name="Payment_NewFromBlank_Default" method="post" action="https://test.sagepay.com/Simulator/VSPFormGateway.asp”>

Using this setting I get this error (see attached pic1), where it says I haven’t provided the Vendor name (even though I added the Vendor name in the Checkout Wizard).

So I manually added the Vendor name to the confirm.php page, by changing this line…
<input id="Vendor" name="Vendor" type="hidden" value="<?php echo("".($WA_SagePay_VSP_Form_Vendor) .""); ?>" />

to this…
<input id="Vendor" name="Vendor" type="hidden" value="craftuk" />

Then when I tested it I got this message (see attached pic2), that says the Vendor name is not in the Sage Pay database. So I spoke to Say Pay customer support again and they said it’s because the form is pointing to…
https://test.sagepay.com/Simulator/VSPFormGateway.asp

And it shouldn’t be (even though that’s what the Checkout Wizard automatically set it to!!!)

They told me to change the form to point to…
https://live.sagepay.com/gateway/service/vspform-register.vsp

So I did that by changing the form tag to...
<form class="NewFromBlank_Default" id="Payment_NewFromBlank_Default" name="Payment_NewFromBlank_Default" method="post" action="https://live.sagepay.com/gateway/service/vspform-register.vsp”>

But now when I process the confirm page with the Vendor set to…
<input id="Vendor" name="Vendor" type="hidden" value="<?php echo("".($WA_SagePay_VSP_Form_Vendor) .""); ?>" />

I get a different looking error page saying the Vendor name needs to be included (see attached pic3).

But when include it by manually changing the Vendor to this…
<input id="Vendor" name="Vendor" type="hidden" value="craftuk" />

I get strange HTML code displaying in my browser (see attached pic4), I’ve highlight in red that it looks like it doesn’t like the Currency field this time and says that field is missing! Even though the currency field is correctly in the form…
<input id="Currency" name="Currency" type="hidden" value="<?php echo("GBP"); ?>" />

I don’t really want to start messing with that currency field if the problem is something else entirely. So I though I’d run it passed you to see if you have any ideas where I’m going wrong???

Many thanks for your time, hope it all makes sense.

Richard

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

daniel279790

Hi jason
I've sent the details privately.

many Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

on the confirm page, i added the following code for the gateway credentials to work:
<?php require_once("webassist/ecart/checkout/credentials/gateways.php"); ?>


the checkout is now going to sage pay with the message:
Status: INVALID

Status Detail: 3087 : The SuccessURL format is invalid.



the success and failure URLS are not right:
<input id="SuccessURL" name="SuccessURL" type="hidden" value="<?php echo("checkout_success.php"); ?>" />
<input id="FailureURL" name="FailureURL" type="hidden" value="<?php echo("checkout_failure.php"); ?>" />

they need to full URLS back to the site, and they don't need to use PHP echo::
<input id="SuccessURL" name="SuccessURL" type="hidden" value="http://www.craftuk.net/test/checkout_success.php" />
<input id="FailureURL" name="FailureURL" type="hidden" value="http://www.craftuk.net/test/checkout_failure.php" />

Sign in to reply to this post

daniel279790

Hi Jason
Thanks for getting back to me. I've changed the urls of the checkout_success and failure pages but I;m still getting errors. If you try it again now, it says...

<div class="sectionheader noTopMargin">Form Transaction Error</div>
</div>
<div class="greyHzShadeBar"> </div>
<table border="0" cellpadding="5" cellspacing="0" width="575" align="center">
<tr>
<td colspan="2" width="575"><br />This transaction attempt has failed. Please use the Proceed button go back to the web store from which you were purchasing.
The details of the failure are given below.<br /><br /></td>
</tr>
<tr>
<td valign="top" class="bodytextbold" width="100" align="right">Status:</td>
<td>MALFORMED<br /><br /></td>
</tr>
<tr>
<td valign="top" class="bodytextbold" width="100" align="right">Status Detail:</td>
<td>3143 : The Billing information is required.<br /><br /></td>
</tr>
<tr>
<td colspan="2" align="right" bgcolor="#ffffff" width="575"><a onmouseover="activate('proceed')" onmouseout="inactivate('proceed')"
href="http://www.craftuk.net/test/checkout_failure.php?crypt=Ag8aI1hFBRYgFTI2eQV1d2JYRXECDmhZUk5kdRJkEhMsIxB6TAAXX1RMFGRwGQJyZFxZAXUOYkNTTm4SaXF1BmYsQXUFcWFZWwdwADBVNTInVzkGe3EePC4/EnUXQCAzIRkwIkNWOAJeSWdndxR7ZwACEWd1Xj0CChQxcy1aJygmBxUzXlg/TgoJdiEhRTQuJg8QaRF2PAEWFCJudwFvdWw="><img name="proceed" align="center" src="Default/en/English_Proceed_grey.gif"
alt="Proceed"

Any ideas why this is happening, I've not messed with any of the code so its just as Ecart created it :(

Many Thanks

Richard

Sign in to reply to this post

Jason ByrnesWebAssist

on the confirm page, do a find and replace,

find:
[FORMREF]

and replace it with:
CheckoutWizard_NewFromBlank_Default

for example:
<input id="CustomerEMail" name="CustomerEMail" type="hidden" value="<?php echo("".(WA_getSavedFormValue('[FORMREF]','Email_Address')) .""); ?>" />


should be:
<input id="CustomerEMail" name="CustomerEMail" type="hidden" value="<?php echo("".(WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Email_Address')) .""); ?>" />

Sign in to reply to this post

daniel279790

Hi again Jason
Thanks for that, I've updated the confirm.php page as you said but I'm still getting problems.

It looks like it doesn't like the US State field for some reason??? (see attached pic5)

Also when I try it in Safari on a Mac, instead of the Sage Pay Error Page, I get all the code displaying in the browser (see attached pic6)

Any ideas what the problem with this is?

Many Thanks again

Sign in to reply to this post

Jason ByrnesWebAssist

I Updated the confirm page and the WA_eCart/checkoutScripts/Protx_VSPForm.php page to include the billing state, I'll log a bug that should be included to have this corrected in a future update.

I am not able to reproduce the problem you are describing in Safari, all of my testing has been done in safari, and I only see the page source code if I right click and select view source.

Sign in to reply to this post

daniel279790

Hi again Jason

Thanks again for your help. It now works great in the test environment.

But now I've come to add it to the live site, I'm hitting problems again :(

Any more help would be great ta.

Sign in to reply to this post

daniel279790

Sorry Jason, I forgot to add what the problem on the live site is...

It was going to SagePay okay but I was getting the 'missing currency field' error again. So I implemented the various changes you made to the test site.

But now it won't get passed the checkout page. If you hit the 'Continue' button it doesn't do anything, it just gets stuck on the 'Please Wait spinning wheel'!!!

Many Thanks again

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