Post by Chris P Duck » Wed May 05, 2010 9:54 pm

Hi,
I'm making a module for SagePay Server as Opencart doesn't have this as a payment option.

So far it's all ok, but in my callback script, I'm trying to access a session variable for the order which I believe should be in $this->session->data['order_id']

My error log is showing this as an undefined variable, and when I've tried to display this using print_r($this->session->data) it is indeed missing.

This is a problem because I need to update the order status when SagePay's servers run my callback script to say the payment has been successful.

I assumed that as this was a session variable it shouldn't be cleared (unless I specifically coded something to do that, which I haven't done). Can anyone advise on this? It's stopping me getting this module working

Newbie

Posts

Joined
Fri Mar 19, 2010 12:24 am

Post by twuncher » Fri May 21, 2010 7:45 pm

just some help that was posted on sagepay forum https://support.sagepay.com/forum/Topic10228-29-1.aspx

hows this mod going?

Newbie

Posts

Joined
Sat May 15, 2010 7:42 pm

Post by Qphoria » Fri May 21, 2010 10:03 pm

If it is a server-to-server callback, then there is no session for the server. The client has the session.

Best bet, for reliable lookup, is to pass back the order id in the callback url parameters.
Then do a fresh db lookup on that order instead of trying to pull it from the session.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Chris P Duck » Mon May 24, 2010 6:22 pm

I've got it working, but I'm still not sure why it needs to be done in the way described above.

I'm sending over the order ID as part of my callback URL:

$data['NotificationURL'] = html_entity_decode($this->url->https('payment/sagepay_direct/notification&order_id=' . $this->session->data['order_id']));

$this->session->data['order_id'] is available in the send() function of the controller, but in the notification() function it isn't. Both functions are run on the same server from the same controller file, so why is one session variable available in one function and not the other? I'd expect it to be the same in both, which is why I posted the original message because it's not something I can understand.

Newbie

Posts

Joined
Fri Mar 19, 2010 12:24 am

Post by pcmammoth » Mon Jun 27, 2011 10:16 pm

Hi Chris. I was wondering whether you were successful in developing an opencart module for SagePay Server.

Thanks

Newbie

Posts

Joined
Mon Jun 27, 2011 10:06 pm
Who is online

Users browsing this forum: No registered users and 11 guests