Zen Cart Logo
Forums / Addon Payment Modules / Nixaks Sagepay Form Module

Nixaks Sagepay Form Module

Views: 60,942

Results 81 to 100 of 214
21 Apr 2010, 10:10 PM
#81
kcmp avatar

kcmp

New Zenner

Join Date:
Apr 2010
Posts:
6
Plugin Contributions:
0

Nixaks Sagepay Form Module

Strange, I don't see a "Transaction Type" option. There are several text boxes in the SagePay Form settings that are unlabelled. I typed "payment" into the one between "Transaction Mode" and "Transaction Currency," but that didn't seem to have any effect. Here's a screenshot of what I'm talking about:

22 Apr 2010, 12:04 PM
#82
nixak avatar

nixak

Zen Follower

Join Date:
Nov 2007
Location:
Essex, UK
Posts:
137
Plugin Contributions:
1

Re: Nixaks Sagepay Form Module

Aha thank you for the picture it should not look like that, it should like this

I have downloaded the file from zen-cart and it appears to be fine. All I can recommend at this moment is that you remove the module via your admin panel, then delete the files, re-download the module from zen-cart and try a fresh install.

Also are you using any mods especially any that alter the admin side at all?

22 Apr 2010, 3:27 PM
#83
kcmp avatar

kcmp

New Zenner

Join Date:
Apr 2010
Posts:
6
Plugin Contributions:
0

Re: Nixaks Sagepay Form Module

Thanks so much for your help. I uninstalled the module, and then re-installed it, and it seems to work fine now.

22 Apr 2010, 9:30 PM
#84
nixak avatar

nixak

Zen Follower

Join Date:
Nov 2007
Location:
Essex, UK
Posts:
137
Plugin Contributions:
1

Re: Nixaks Sagepay Form Module

KCMP:

Thanks so much for your help. I uninstalled the module, and then re-installed it, and it seems to work fine now.

Your more then welcome KCMP :D just glad to hear you have it all working :clap::clap:

23 Apr 2010, 2:42 AM
#85
kcmp avatar

kcmp

New Zenner

Join Date:
Apr 2010
Posts:
6
Plugin Contributions:
0

Re: Nixaks Sagepay Form Module

Nixak:

Your more then welcome KCMP :D just glad to hear you have it all working :clap::clap:

I can't imagine what could have caused the problem

12 May 2010, 2:42 PM
#86
avova avatar

avova

New Zenner

Join Date:
May 2010
Posts:
4
Plugin Contributions:
0

Re: Nixaks Sagepay Form Module

MaryF:

If someone could help with adding an if / else statement in the code then we could get the billing info sent to SagePay if it is a download product and there is no delivery address.

Here is the section of code inside the file called includes/modules/payment/sagepay_form.php.

How do I add the statement in the section after this line:
```
$plain .= "BillingPhone=" . $order->customer['telephone'] . "&";

> 
> In other words, the code must check to see if the customers delivery address OR postcode is empty. If both or any of the delivery fields are empty, it posts the billing address to SagePay instead.
> 
> 
> 		```
$plain .= "BillingPhone=" . $order->customer['telephone'] . "&";	
		$plain .= "DeliverySurname=" . $order->delivery['lastname'] . "&";
		$plain .= "DeliveryFirstnames=" . $order->delivery['firstname'] . "&";
		$plain .= "DeliveryAddress1=" . $order->delivery['street_address'] . "&";
      if (ACCOUNT_SUBURB == 'true') {
        $plain .= "DeliveryAddress2=" . $order->delivery['suburb'] . "&";
    }
		$plain .= "DeliveryCity=" . $order->delivery['city'] . "&";
		$plain .= "DeliveryPostCode=" . $order->delivery['postcode'] . "&";
		$plain .= "DeliveryCountry=" . $order->delivery['country']['iso_code_2'] . "&";

Would appreciate come help with this.thanks.

Hi,

I've had the same problem as above and I've added a couple of lines that basically check to see if the Delivery information is missing ( to be specific I check the street address and country ) and if it is I copy the billing details into the delivery details array.

I've tested it and it works fine for me.

See modified file attached with the updated code commented.
I hope someone else will find it usefull

Regards,

Mark
www.avova.ie

12 May 2010, 3:00 PM
#87
avova avatar

avova

New Zenner

Join Date:
May 2010
Posts:
4
Plugin Contributions:
0

Re: Nixaks Sagepay Form Module

Oh and I forgot to thank you Nixak for the great module.

If you need any help with testing/developing it further please just let me know.

Regards,

Mark
https://www.avova.ie

12 May 2010, 10:45 PM
#88
nixak avatar

nixak

Zen Follower

Join Date:
Nov 2007
Location:
Essex, UK
Posts:
137
Plugin Contributions:
1

Re: Nixaks Sagepay Form Module

Hi avova, I just wanted to ask you about that delivery address problem as I don't sell virtual products so it's a little difficult for me lol.

As I understand it from my store when the customer registers to the store they enter the main address ie the billing address and then when they order they can either have the goods sent to that address or enter a new address. If they do not enter a new delivery address then zen-cart automaticly sends the billing address as the delivery address, so you should not have a problem unless you are using a mod that allows your customers to order without registering to your site.

Is there something different with virtual products? which causes the problem listed above and if so could you give me as much detail as possable so as I can re-code the module to help you all.

Regards
Nixak

13 May 2010, 10:29 AM
#89
avova avatar

avova

New Zenner

Join Date:
May 2010
Posts:
4
Plugin Contributions:
0

Re: Nixaks Sagepay Form Module

Yeah no problem.

Basically what happens is with a download/virtual product the entire shipping process is bypassed and $order->delivery[] is left with blank fields.

The code I used to fix the issue is highlighted by code comments in the file I attached in my previous post. (It's at the top of the process_button() function )

All I'm doing here is checking to see if the $order->delivery array is empty and if it is I copy the details from the $order->billing array to it and that keeps SagePay happy.

I hope that clears things up for you.

Regards,
Mark
www.avova.ie

13 May 2010, 10:42 AM
#90
nixak avatar

nixak

Zen Follower

Join Date:
Nov 2007
Location:
Essex, UK
Posts:
137
Plugin Contributions:
1

Re: Nixaks Sagepay Form Module

Cheers Avova I will update the module with those changes as soon as I can .... the wife has me updating her website at the moment :(

13 May 2010, 2:51 PM
#91
avova avatar

avova

New Zenner

Join Date:
May 2010
Posts:
4
Plugin Contributions:
0

Re: Nixaks Sagepay Form Module

No problem at all.

And like I said if you need any help with development/testing just let me know.

Regards,
Mark
www.avova.ie

15 May 2010, 10:58 AM
#92
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

Re: Nixaks Sagepay Form Module

Hi Nixaks!
Thanks for this mod...it installed and worked 1st time!
Just a couple of quick question....is there anywhere that tells me in admin that a payment was authorised or is the only confirmation the email sent from sagepay?
If it's just the email, is there any way of tying the order ID within zen cart to the transaction ID from sagepay? Does the transaction ID get written to the database anywhere?

Also, when a payment is refused the user is returned to the payment screen in Zen Cart. Is there any way to display a message to say the payment was refused?

I am using Zen Cart version 1.3.8a and am still using sagepay in test mode.

Thanks again for the mod...it's really good!! :D

15 May 2010, 11:51 AM
#93
nixak avatar

nixak

Zen Follower

Join Date:
Nov 2007
Location:
Essex, UK
Posts:
137
Plugin Contributions:
1

Re: Nixaks Sagepay Form Module

damiantaylor:

Hi Nixaks!
Thanks for this mod...it installed and worked 1st time!
Hi damiantaylor, your welcome :D

damiantaylor:

Just a couple of quick question....is there anywhere that tells me in admin that a payment was authorised or is the only confirmation the email sent from sagepay?
At this moment in time it's only via the email from Sage Pay

damiantaylor:

If it's just the email, is there any way of tying the order ID within zen cart to the transaction ID from sagepay? Does the transaction ID get written to the database anywhere?
Oh I hadn't thought of that :blink: .... I will look into this when I have 5 mins

damiantaylor:

Also, when a payment is refused the user is returned to the payment screen in Zen Cart. Is there any way to display a message to say the payment was refused?

I am using Zen Cart version 1.3.8a and am still using sagepay in test mode.

Thanks again for the mod...it's really good!! :D
Again unfortunatly not at this moment, however this is something i'm working on, just the coding for this is extremly difficult (esp as i'm fairly new to coding lol) but this is something my wife has been nagging me about for ages, as I created this module for her site (the one listed in my sig)

I will try to look in to this some more tomorrow as unfortunatly I'm off to work in a minute :yuck:

Hope this helps
Nixak

15 May 2010, 12:12 PM
#94
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

Re: Nixaks Sagepay Form Module

Ah, I've just answered one of my questions....If a card payment gets refused, it doesn't create an order in Zen Cart so if I see an order in Zen Cart, I can assume the card payment was authorised.

I'd love to be able to show error messages from sagepay when the user gets back to the payment screen though.
All I currently get is my URL with &crypt= followed by a long string.

15 May 2010, 3:01 PM
#95
nixak avatar

nixak

Zen Follower

Join Date:
Nov 2007
Location:
Essex, UK
Posts:
137
Plugin Contributions:
1

Re: Nixaks Sagepay Form Module

damiantaylor:

Ah, I've just answered one of my questions....If a card payment gets refused, it doesn't create an order in Zen Cart so if I see an order in Zen Cart, I can assume the card payment was authorised.

I'd love to be able to show error messages from sagepay when the user gets back to the payment screen though.
All I currently get is my URL with &crypt= followed by a long string.
The reason for the &crypt followed by a long string is because that's sagepay telling you what the problem is, unencrypting the message is the easy part, however getting that to show to the customer and recording that in your database for you to see is another matter lol. I may have thought of a tempory measure to put in place but I'm at work at the moment so it will have to wait untill tomorrow. I will let you know how it goes :)

Regards
Nixak
Posted via Mobile Device

16 May 2010, 10:07 AM
#96
nixak avatar

nixak

Zen Follower

Join Date:
Nov 2007
Location:
Essex, UK
Posts:
137
Plugin Contributions:
1

Re: Nixaks Sagepay Form Module

Hi all,

I have come up with a tempory way of informing your customers if they have had a problem whilst making a payment :clap:

First off you will need to create an ez page, so go to admin/tools/ez-pages and click the new file button.
Then enter whatever message you want you customers to see. At the top of the ez-page use the following settings

opens new window = no
page is SSL = yes
header = no
sidebox = no
footer = no
TOC = no
Chapter number = leave this as 0

and enter your own page title and click the update button.
DO NOT put anything in the internal or external URL link

Now take note of the id number for your new page (it will be listed on the left hand side)
Next go to https://www.yourwebsite.address/index.php?main_page=page&id=ID number (replace the yourwebsite.address and ID number with you details) and you should see your new ez-page, copy the full url.

Last bit :D using a good text editor (such as notepad++) open the file includes/modules/payment/sagepay_form.php and find this line

$plain .= "FailureURL=" . zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true) . "&";

replace the zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true) part with your ez-page url you copied earlier and inclose the url within speech marks, so you should have a line like this

$plain .= "FailureURL=" . "https://www.[I]yourwebsite.address[/I]/index.php?main_page=page&id=[I]ID number[/I]" . "&";

Save the file and upload it to where it belongs ( includes/modules/payment/sagepay_form.php) ... your done :clap:

Hope this helps untill I can get time to code the backend of the module
Nixak

17 May 2010, 9:48 AM
#97
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

Re: Nixaks Sagepay Form Module

Thanks Nixak!
I was thinking a temporary fix could be to decrypt the message from the &crypt variable in the URL in file /includes/modules/pages/checkout_payment/header_php.php and add any error messages to the message stack for that page.
I'm not sure if this would work and I haven't had time to test it yet but I'll hopefully get a chance to give it a try tonight.
If not, your fix sound good.

20 May 2010, 1:50 PM
#98
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

Re: Nixaks Sagepay Form Module

Nixak,
I've tried to understand why the error messaging doesn't work but I'm stumped!
I've tried logging points in the php code using firephp and get_error() never seems to fire for some reason.

I've had a look at other similar modules and they don't seem to do much different than this one.

There must be some reason get_error doesn't fire, maybe some variable not set or something?
The strange thing is it works if you redirect to an easy page?

22 May 2010, 11:59 AM
#99
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

Re: Nixaks Sagepay Form Module

Hi Nixak, Me again!
I've done some more investigation and I think this may be a problem with Zen Cart rather than your mod.
I've found a Sage Pay form mod for osCommerce and modified it to work (in a fashion!) with Zen Cart.
When it came back with an error, it did exactly the same thing as your mod does....just has the &crypt string in the URl.
I've tried the same thing with PayPal and although it doesn't go back to the checkout_payment screen (it goes back to the checkout_shipping screen for some reason) it still shows no messages; just &ec_cancel and &token in the URL.

It may be worth asking if get_error() is a Zen Cart bug before you go pulling any more hair out :)

22 May 2010, 1:48 PM
#100
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

Re: Nixaks Sagepay Form Module

I've found some threads that suggest you can't use the URL for passing long strings like payment error messages any more:
http://www.zen-cart.com/forum/showthread.php?t=136174
http://www.zen-cart.com/forum/showthread.php?t=132652
http://www.zen-cart.com/forum/showthread.php?t=113808

The last one suggests using the message stack in the before_process function as in authorizenet.php supplied with Zen Cart.
The only thing I don't understand is, you pass the failureURL to SagePay and they redirect you to the page in question, so how does before_process ever get to fire?

I hope this all helps!