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