Forums / Addon Payment Modules / Possible Sermepa payment module problem

Possible Sermepa payment module problem

Views: 2,270

Results 1 to 12 of 12
13 Apr 2011, 7:26 PM
#1
vimad avatar

vimad

New Zenner

Join Date:
Oct 2010
Posts:
20
Plugin Contributions:
0

Possible Sermepa payment module problem

Hi all:

I am a bit desperate right now... I have searched not only the forums, but also all over internet and I do not find any solution to this:

I am using 1.3.8a

When a customer pays with credit card (this does not happen with any other means of payment), everything seems to go fine and after payment the cart is cleared.

However, when the customer logs in again... everything is back in the cart!!

I do not know what to do. Any help would be really apreciated.

Thanks,

Vimad.

This is me: :frusty: and then :lamo:

13 Apr 2011, 10:06 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Possible Sermepa payment module problem

From what you've said, I'd look first at the payment module you're using for credit card processing. Sounds like it may be a problem with how it comes back to the cart.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

13 Apr 2011, 10:31 PM
#3
vimad avatar

vimad

New Zenner

Join Date:
Oct 2010
Posts:
20
Plugin Contributions:
0

Re: Possible Sermepa payment module problem

kuroi:

From what you've said, I'd look first at the payment module you're using for credit card processing. Sounds like it may be a problem with how it comes back to the cart.

Kuroi, first of all thank you.

Well, the point is that when it returns it seems to work properly (the cart is emptied); it is possible to continue surfing the web and the cart will be empty. The problem arises when the client logs in again... Are you sure it has to do with the payment module? (it is sermepa).

Any idea?
Posted via Mobile Device

13 Apr 2011, 10:43 PM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Possible Sermepa payment module problem

Sounds like the cart information in the session is being cleared down, but the stored basket isn't being. That's only half the job, so I wouldn't characterise that as working properly.

Am I sure that it's the payment module? Absolutely not, that's just where I'd start looking given that you've said that it doesn't affect non-card payment methods, making it the most likely candidate.

But other possibilities would be any checkout mods that you're using and any custom code you have there.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

15 Apr 2011, 12:37 AM
#5
ebusinessman avatar

ebusinessman

Zen Follower

Join Date:
Jul 2006
Posts:
132
Plugin Contributions:
0

Re: Possible Sermepa payment module problem

check the file:

includes/modules/checkout_process.php

find the codes where cart empty itself, see if it works (you may need to add your own code)

sometimes, these codes never being reached.

17 Apr 2011, 1:23 PM
#6
vimad avatar

vimad

New Zenner

Join Date:
Oct 2010
Posts:
20
Plugin Contributions:
0

Re: Possible Sermepa payment module problem

Sorry I have not been able to answer before.

As you say, the cart information in the session is being cleared down, but the stored basket isn't being. (And you are more than right saying that "I wouldn't characterise that as working properly" :smile:).

I followed your suggestion and reinstalled the module, but it has not solved the issue.

Honestly, I am completely lost. I do not know what to do. I have not installed new checkout modules. The only changes I can think of were done once the cart was already not working properly.

Any idea would be highly appreciated.

17 Apr 2011, 2:43 PM
#7
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Possible Sermepa payment module problem

The module was orginally written for osCommerce which works differently to Zen Cart and ported over. A quick scan of the code shows that it still contains much that is more osCommerce than Zen Cart suggesting that the port wasn't very thorough.

In addition, almost four years and two major released of Zen Cart Cart have passed since it was last updated.

So, there's no guarantee that this payment module will work properly against a current Zen Cart, or even the 1.3.8a that you're using.

I can't say for sure that it is the source of the problem, but as you don't have problems with other payment methods, it seems likely.

I've changed the title of my response in the hope that it attracts the eye of somebody who's worked with this payment module.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

17 Apr 2011, 2:58 PM
#8
ebusinessman avatar

ebusinessman

Zen Follower

Join Date:
Jul 2006
Posts:
132
Plugin Contributions:
0

Re: Possible Sermepa payment module problem

find file:
includes/modules/pages/checkout_process/header_php.php

line 19:
$_SESSION['cart']->reset(true);

to see if it has "true" there.

if yes, then you have to check:

includes/classes/shopping_cart.php

line 195:
function reset($reset_database = false) {
....
}

to see if this is normal. Or you can add some code here to detect if this has been visited after checkout.

17 Apr 2011, 3:28 PM
#9
vimad avatar

vimad

New Zenner

Join Date:
Oct 2010
Posts:
20
Plugin Contributions:
0

Re: Possible Sermepa payment module problem

Thanks for your very fast replies. Some more info:

@Kuroi: The module works in Zen Cart (I have had it installed for months without any problem); so it should not be a source issue.

@ebusinessman: Thanks for the help too. The files you mention are exactly as you say. I have not added the code you mention, because I do not know what to add.

Some more info:

1.- I have compared all files of the module currently on the server with an old backup (when it worked)... and there are no differences on the code. :frusty:

2.- The bank uploaded a personalization of the pages in their server to match mines. However, I do not think that this can be the issue, because when customers pay and return the cart is emptied. It is only "reloaded" when the customer logs in; this makes me thing that the info on the bank server has nothing to do with the problem (...but I may be wrong).

Are there any other files dealing with the cart and sessions?

Desperate is a soft word to express how I feel. :censored: + :cry:

17 Apr 2011, 10:32 PM
#10
vimad avatar

vimad

New Zenner

Join Date:
Oct 2010
Posts:
20
Plugin Contributions:
0

Re: Possible Sermepa payment module problem

Well, after a horrible weekend I think that it is solved:

In file sermepa_process.php change:

unset($_SESSION['cart']);

for $_SESSION['cart']->reset(true);

¿easy? It has taken me three days....

17 Apr 2011, 11:08 PM
#11
ebusinessman avatar

ebusinessman

Zen Follower

Join Date:
Jul 2006
Posts:
132
Plugin Contributions:
0

Re: Possible Sermepa payment module problem

congratulations, that's something I thought of.

$_SESSION['cart']->reset(true) here must have a true.

Then we can assume sermepa_process.php takes care of checkout process, rather than /modules/pages/checkout_process/header_php.php takes care of this.

17 Apr 2011, 11:38 PM
#12
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Possible Sermepa payment module problem

Well done. I realise now that there are two Sermepa modules. I assume that you're using the recent one.

This is a hugely better version than the old one, but it does do something really, really dangerous - as you've identified. Specifically, on callback from the gateway, instead of integrating with Zen Cart's order completion processing, it tries to replace the entire process with its own version.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)