Zen Cart Logo
Forums / Addon Payment Modules / WorldPay Module for ZenCartv1.3x

WorldPay Module for ZenCartv1.3x

Locked

Views: 137,079

Results 341 to 360 of 464
This thread is locked. New replies are disabled.
12 Jul 2008, 08:12
#342
marcps avatar

marcps

Zen Follower

Join Date:
Feb 2005
Posts:
92
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

Misty - I have already tried that....

I am stil not getting results :(

Marc

12 Jul 2008, 08:48
#343
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: WorldPay Module for ZenCartv1.3x

marcps:

Misty - I have already tried that....

I am stil not getting results :(

Marc
Suggest you contact mod dev and seek his help, even if you have to
pay small fee....save u lot of time and trouble.
:smile:

15 Jul 2008, 23:10
#344
rued avatar

rued

Zen Follower

Join Date:
Oct 2005
Location:
Finland
Posts:
186
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

marcps:

I have upgraded to the beta version of the new worldpay module - and this has fixed the php5 error error.

Now getting redirect 302 errors on the wp_callback

I have now tested the beta on PHP5, and can confirm this bug ... :)

21 Jul 2008, 14:22
#345
kru avatar

kru

New Zenner

Join Date:
Apr 2008
Posts:
8
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

Hello all any update on this callback bug?

21 Jul 2008, 17:43
#346
worldfashion avatar

worldfashion

New Zenner

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

Re: WorldPay Module for ZenCartv1.3x

The callback is not working. I am using zen cart version 1.37 with php 4.4 .

23 Jul 2008, 01:34
#347
andrie avatar

andrie

New Zenner

Join Date:
May 2008
Posts:
3
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

Re: Callback problem between Zen Cart and WorldPay (Workaround follows)

After extensive testing, a terrific friend has confirmed the issue IS DEFINITELY the ZC session not existing for the WP call back... (the final thankyou page is actually called by the WP web server itself and sent to the user/browser. Thus, the request comes from a machine that has no active session).

The following is a workaround to the problem that my friend has worked out for me. It’s not perfect (i.e. not 100% elegant) but does the job. If Alan and others who have their hands in the code would like extra (lengthy) observations/diagnostics that drove this workaround just let me know and I’ll forward my friends notes. Hopefully a more elegant solution will be incorporated into a future release.

**WORKAROUND: **
Create an "interim hack page" that echoes the callback info before it gets dropped. In the description below the hack page is called ‘wpcallbackhack.php’.

Step 1. Make one mod in the system... in the file includes\modules\payment\worldpay.php --

Line:
```
zen_draw_hidden_field('MC_callback', $worldpay_callback[1]);


Now reads:
       ```
zen_draw_hidden_field('MC_callback', 'www.domain.com/store/wpcallbackhack.php?main_page=wpcallback' );

Step 2,. Place the hack page in the referenced directory. Suggest the the page includes an appropriate text message explaining what is happening so users don't get alarmed. (comfortably addresses concerns about credit card info being passed.) Go to https://www.justkiddintheatre.com/store/wpcallbackhack.php to see mine.

WP now calls the hack page... which then rebuilds the hidden form fields that WP would have posted in the call back... but we need to make the user click submit, so the request comes from the user's browser - which has an active session. Thus it works.

I will leave my WP in test mode for a few days if you want to see how it works in a real situation. https://www.justkiddintheatre.com/store

Hope this helps others out there.

Andrie

PS: Using ZenCart 1.3.8 with PHP 4.4.8

23 Jul 2008, 08:28
#348
duncanad avatar

duncanad

Zen Follower

Join Date:
Nov 2004
Location:
Glasgow, Scotland
Posts:
247
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

Andrie,

Your suggested changes to the WorldPay module takes things back several years to how this module originally worked when I first came across it. At that time no one wanted to use it because customers would not read the screen and mostly either closed their browser, or moved off elsewhere, without clicking the 'Click here to continue' button.

Also I doubt whether it provides a solution at all - consider two customers who make a purchase around the same time. How does the script you suggest hold both customers details for retreivel later? How does it distinguish between customers? These issues are exactly what sessions are all about.

I have documented the 'Loss of session' issue several times previously in this thread. Callback failure is almost invariably caused by the Zencart host server not maintaining the session. The session information is contained within the WP callback but some hosts for some reason are not able to re-establish the session. When the session is lost the core Zencart script redirects to the login page so that the customer can login and re-establish the session in that way. Worldpay, for security reasons, does not allow the callback to be re-directed. When WorldPay detects a re-direct it displays the standard WorldPay response page (which is user editable) rather than the Zencart response page.

If you have callback failure you should first contact your host and ask whether their setup maintains sessions - tell them why you are asking the question. If they cannot help - change host. All other solutions are likely to be in-elegant and require at least some element of manual intervention.

I have NEVER had a callback issue with my server. I host Zencart installations for both my own clients and on behalf of others - all using the WorldPay module 'out of the box'.

Regards,

Alan

23 Jul 2008, 16:20
#349
kru avatar

kru

New Zenner

Join Date:
Apr 2008
Posts:
8
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

Hello *****,

We have been through a test and looking at the logs for your site it appears that worldpay are not attempting the callback. We would suggest speaking to both the shopping cart developers and worldpay for advise on this.

Best Regards,
Support

I am totally stumped.

23 Jul 2008, 20:17
#350
andrie avatar

andrie

New Zenner

Join Date:
May 2008
Posts:
3
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

Update to all interested in the broken callback issue.

I was personally satisfied with the workaround I previously posted for my purposes but my friend has since produced a more elegant solution that I'm extremely pleased with (and works beautifully on my site). I'm forwarding below his note to me that describes what he did. Again, I will leave my worldpay part in test mode for a day or so for others to look at if they like.

=======Notes from Steve==========

  1. I am sort of understanding the ISP PHP session issue thing a bit... while the ZC settings are to store sessions in the db... this does not store the ENTIRE session in the db, ZC still stores some values in memory. PHP has the capability to allow "transient" sessions... if your browser passes in a valid session id, you can have your program "connect" you back to your current in-memory session.... In my mind, quite a serious security issue -- but none-the-less, the functionality is there. It may be the case the some ISPs disable the functionality in PHP through the runtime config.

  2. That said, there is no reason why a session can't be reconstituted on the fly... if you know what the session vars&vals were before, just re instantiate them... Fortunately, there is a method in PHP to allow this to occur fairly easily. So this is what i did - knowing that transient sessions were not possible on your server.... the real effective changes meant only adding one line to worldpay.php and one line to tpl_wpcallback_default.php. I changed just one more line in tpl_wpcallback_default.php to clean up a "Continue" button issue.

In worldpay.php, I inserted the line "zen_draw_hidden_field('MC_zcsession', session_encode()) ." in the code block that write the final confirm form before sending you off to world pay.

From this:

  ```

$process_button_string .=
zen_draw_hidden_field('testMode', MODULE_PAYMENT_WORLDPAY_TEST_MODE) .
zen_draw_hidden_field('name', $order->customer['firstname'] . ' ' . $order->customer['lastname']) .
zen_draw_hidden_field('address', $address) .
zen_draw_hidden_field('postcode', $order->customer['postcode']) .
zen_draw_hidden_field('country', $order->customer['country']['iso_code_2']) .
zen_draw_hidden_field('tel', $order->customer['telephone']) .
zen_draw_hidden_field('myvar', 'Y') .
zen_draw_hidden_field('fax', $order->customer['fax']) .
zen_draw_hidden_field('email', $order->customer['email_address']) .
zen_draw_hidden_field('lang', $_SESSION['languages_code']) .
zen_draw_hidden_field('MC_callback', $worldpay_callback[1]);


To this:

  $process_button_string .=    
    zen_draw_hidden_field('testMode', MODULE_PAYMENT_WORLDPAY_TEST_MODE) .
    zen_draw_hidden_field('name', $order->customer['firstname'] . ' ' . $order->customer['lastname']) .
    zen_draw_hidden_field('address', $address) .
    zen_draw_hidden_field('postcode', $order->customer['postcode']) .
    zen_draw_hidden_field('country', $order->customer['country']['iso_code_2']) .
    zen_draw_hidden_field('tel', $order->customer['telephone']) .
    zen_draw_hidden_field('myvar', 'Y') .
    zen_draw_hidden_field('fax', $order->customer['fax']) .
    zen_draw_hidden_field('email', $order->customer['email_address']) .
    zen_draw_hidden_field('lang', $_SESSION['languages_code']) .
    zen_draw_hidden_field('MC_zcsession', session_encode()) .
    zen_draw_hidden_field('MC_callback', $worldpay_callback[1]);

This converts the current session vars&vals to a string, and sends them over to WP in a custom field which WP will send back in it connection back to ZC.

Then in tpl_wpcallback_default.php, I had to grab that session string, and reconstitute the session manually before additional processing by the server.  My code is added before any other code in the file, right after the comment:

   //  get values from WorldPay response - see <http://support.worldpay.com/kb/customising3/paymentpageeditor.html>

Inserted code:

if(isset($_POST['MC_zcsession'])) {session_decode(str_replace('"', '"', $_POST['MC_zcsession']));}


Now, there is a slight side effect in this fix, and that is upon WPs call back to ZC, you end up getting logged out.  I suspect that this is because I am attempting to reconstitute the session AFTER the native ZC session init code runs.  Since the session init code runs before my code, it results in ZC thinking that the user is not logged in... This results in odd behaviour if the user clicks "My Account" link or the "Continue" button from the confirmation page....they see "Ooops, session timed out, please log in".... 

I resolved two issues with the Continue button on the final confirmation page... first, I converted it to a simple link, instead of a form submit -- this got rid of the "Warning:..." message given to the user since in this case they are submitting from a secure page at WP to a non-secure one on your site.  The second issue was the re-login issue... to fix that, I just repointed the Continue link to the top of the store site... where you do not need to be logged in.  If the user then wants to buy more, or check their account... they would have to log in again, but i would say that this will be far fewer users... and it won't seem so bad since they are now fully out of the purchase stream.

The fix for the continue link changes code from:

<?php echo zen_image_submit(BUTTON_IMAGE_CONTINUE, BUTTON_CONTINUE_ALT); ?>
To:

<?php echo '<a href="' . zen_href_link('/', '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CONTINUE, BUTTON_CONTINUE_ALT) . '</a>'; ?>


 So... while this is not 100% PERFECT... it alleviates that nasty interim "Click to Continue" page....and I think is nearly perfect enough to satisfy your needs.
26 Jul 2008, 15:23
#351
worldfashion avatar

worldfashion

New Zenner

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

Re: WorldPay Module for ZenCartv1.3x

I am using 1.37 version php 4.4. After making the payment when worldpay redirects to my site I get this message:
Warning: Cannot modify header information - headers already sent by (output started at includes/templates/template_default/common/html_header.php:22) in /includes/functions/functions_general.php on line 44.
Although this problem has been addressed many times in this forum but no one could find a solution for it.
I have even uploaded all the templates files in a fresh manner but the same problem comes.
If in tpl_wpcallback_default I replace

if(isset($_POST['transId'])) {$transId = $_POST[transId];}
if(isset($_POST['transStatus'])) {$transStatus = $_POST[transStatus];}
if(isset($_POST['cartId'])) {$cartId = $_POST[cartId];}
if(isset($_POST['name'])) {$name = $_POST[name];}
.........
with $_GET I am taken back to my site with the following info:
Transaction cancelled: No money changed hands. Trasaction ID...etc.

To check if there was a server problem I uploaded a new Zen cart version 1.38a and the module works fine. Please help as starting with a new zen cart is not an option.

28 Jul 2008, 16:42
#352
coley144 avatar

coley144

New Zenner

Join Date:
Jun 2006
Posts:
19
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

Hi

I'm pretty sure I've tried everything in this thread and i can't get callback to work. I can go through to Worldpay and pay fine but then nothing happens in zencart.

I'm using zencart 1.3 php 4.4.8
Can pm website addy.

Here's what I've tried so far:

  1. I've reinstalled the module
  2. I've tried to https fix suggested
  3. I've tried the fix suggested by Andrie
  4. I've contacted my ISP (1and1) who disclaim any knowledge of session timeout.
  5. I've just installed the beta and that doesn't work either.

Obviously it's going to be something really obvious that I haven't thought of but please can anyone help? I'm only vaguely teckie so keep it relatively simple.

Thanks

Coley

03 Aug 2008, 17:27
#353
coley144 avatar

coley144

New Zenner

Join Date:
Jun 2006
Posts:
19
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

Thanks to Andrie's friend Steve my worldpay module is now up and running.

There were two things we (well he!) fixed. NB: I am using the beta module.

  1. In worldpay I have forgotten to set my payment response url to: https rather than http....so the correct link is:
    https://<wpdisplay item="MC_callback">

This got it working fine except when I did a live purchase and was directed back to my website after payment the thank you page said 'Thank You! We Appreciate your Business!
This was NOT a live transaction - no money has changed hands.'

Which was not good as it WAS a live transaction.

That was fixed by changing this file: >includes>templates>template default>template>tpl_modules_wp_checkout_success.php

The previous code was:

if ($testMode !== 0) {echo "<h2>" . WP_TEST_HEADING . "</h2>";}

This was changed to:

if ($testMode != "0") {echo "<h2>" . WP_TEST_HEADING . "</h2>";}

Which has sorted it all out.

Many MANY thanks to Stephen.

09 Aug 2008, 10:31
#354
feesworld avatar

feesworld

New Zenner

Join Date:
Oct 2006
Posts:
2
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

Andrie:

Update to all interested in the broken callback issue.

Send the man a large beer!

Thank-you so, so, so, so much. This has fixed my problem, that I've been working through for the last few days solid.

:clap::clap::clap::clap:

THANK-YOU!!

10 Aug 2008, 18:17
#355
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: WorldPay Module for ZenCartv1.3x

Well, using the beta mod and the callback fixes above, everything works perfectly on php5.2.6 when I run a test transaction, but the moment I switch to live, I get this error immediately I arrive on the Worldpay site:

Sorry, there was an error in processing this transaction: PCSAT.liveOnTest
Server information 10/Aug/2008 18:10:42 Server ID mg1imscs5pa FONT=Verdana[/FONT]

As Worldpay don't man support at the weekend(!), can anyone offer suggestions as to what the problem may be?

Just thought - the site is 1.3.7 - could that be an issue?

17 Aug 2008, 09:09
#356
russki avatar

russki

New Zenner

Join Date:
Aug 2008
Location:
Wellington, NZ
Posts:
4
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

Hmmm

I'm a newbie to this ZenCart malarkey, but seem to be getting there slowly. Like a number of posters on this thread I have been having major problems getting the WorldPay module working, most probably because, as a newb, I've installed the bleeding edge versions of everything :blink:

Anyway, I'm running ZC 1.3.8a using MySQL 5.0.26 and PHP 5.2.3 and after failing miserably with the WP mod 0.1, I have downloaded and installed the beta (thanks Alan!).

As I'm still running in test mode and am waiting for my ISP to sort out my SSL certificate, I made the necessary changes to worldpay.php to allow http connections. The result was 302 errors when I attempted to make the payment on the WP page. BTW I've configured the WP module to use testmode 100, and am using the username 'AUTHORISED' and the WP test Visa card number 4917610000000000.

Following Andrie's post re passing session state to WP, I made the suggested mods to worldpay.php to pass MC_zcsession to WP. I then updated the wp_callback/header_php.ph file to session_decode the returned variable.

I no longer get the 302 errors and the shopper receives a success email from WorldPay and an order confirmation from ZenCart - yay! However, despite the fact that the order is successfully created in ZC, the shopper remains on the Worldpay Thank You page and does not get returned to ZC.

The website is www.portobelloroad.co.nz/store. Whilst I'm cautiously optimistic that we can go with this situation (we're hoping to go live 1/9), all suggestions as to what I can do to get the shopper back into the shop at the end of the transaction will be greatly appreciated.

Russ

21 Aug 2008, 10:03
#357
russki avatar

russki

New Zenner

Join Date:
Aug 2008
Location:
Wellington, NZ
Posts:
4
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

Doh. Turns out the WorldPay 'Enable Shopper Response' checkbox wasn't set...

All is now rosy and testing is continuing. If I have any other issues with the Beta module and ZC 1.3.8, I'll be sure to post!

BTW, big up for Steve (Andries friend) for jumping in and checking things over! Awesome support!

27 Aug 2008, 17:00
#358
jsweb avatar

jsweb

Zen Follower

Join Date:
Jul 2005
Location:
UK and Ireland
Posts:
392
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

Great work guys - this is v.exciting news; the sooner it can be confirmed if the WP module is working in php5 (ready for download) the better.

(If a copy of the beta was sent to us, we would be more than happy to give it a go [test and live modes] on php5.2.6)

Thanks in advance

27 Aug 2008, 17:57
#359
rued avatar

rued

Zen Follower

Join Date:
Oct 2005
Location:
Finland
Posts:
186
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

JSWeb:

(If a copy of the beta was sent to us, we would be more than happy to give it a go [test and live modes] on php5.2.6)

You didn't really take your time reading this tread did you? ;)

You find the link to beta download here http://www.zen-cart.com/forum/showpost.php?p=570504&postcount=325

29 Aug 2008, 09:22
#360
ozgdesign avatar

ozgdesign

New Zenner

Join Date:
Feb 2008
Posts:
5
Plugin Contributions:
0

Re: WorldPay Module for ZenCartv1.3x

Hi duncanad,

Is there any chance you might quote us for tweaking the worldpay module to record the worldpay transaction id , and the security response from worldpay (post code and address matched/ cvv matched). We realy require those changes. We have few websites and a lot of dodgey buyers.