New Zenner
- Join Date:
- Sep 2006
- Posts:
- 79
- Plugin Contributions:
- 0
WorldPay Module for ZenCartv1.3x
I will give it a go and get back to you ASAP, thank you
Views: 137,079
New Zenner
I will give it a go and get back to you ASAP, thank you
New Zenner
nope still wont work :(
Ill keep trying though, Ill take off HTTPS settigns now and try it as non secure and see how I get on
New Zenner
OK latest update, I disabled SSL on site and restored all WP settings back to default, tested everything once again and still the same, all hangs on the WP conf page and callback error.
any ideas ppl
Zen Follower
Dasonix,
I'm not sure you have the same problem - you seem to be running PHP 4.4 which to my understanding should not be an issue but have a look at this post:
http://www.zen-cart.com/forum/showpost.php?p=229504&postcount=32
and at this post as to why this may be an issue:
http://www.zen-cart.com/forum/showpost.php?p=248440&postcount=41
I really need to get round to updating the download files to take care of a couple of known issues that keep arising here. This one I'm not sure how to handle since the solution is dependent upon the version of PHP installed. I think I should probably go for the fix that works on newer versions and include a note for those with versions pre 4.1.
If this doesn't work could you post all your settings in both the Zencart admin and the WorldPay CP. Also a complete copy of the callback failure email from Worldpay.
Regards,
Alan
New Zenner
Ill get back to you ASAP with the results of these fixes.
and see where we can go from there.
New Zenner
Ok we are getting somewhere after that lead.
I actually had the result page show up on our website, but saying that the transaction was cancelled, only once though
Ill test more over he weekend and see how i get on as i want to try it with everything turned off again (seo mod, SSL etc) then Ill get back to you with full results
Zen Follower
dasonix,
You may need the 'just add quotes' fix as well.
http://www.zen-cart.com/forum/showpost.php?p=253886&postcount=63
Glad you are making progress.
Regards,
Alan
Zen Follower
Just to clarify the code for secure and non-secure callback.
For non-secure callback in the WorldPay control panel set the callback url to:
http://<wpdisplay item="MC_callback">
and in includes/modules/payment/worldpay.php at lines 128 and 129 the code should be:
$callback_url = zen_href_link(FILENAME_WPCALLBACK, $zenId);
$worldpay_callback = explode('http://', $callback_url);
For secure callback in the WorldPay control panel set the callback url to:
https://<wpdisplay item="MC_callback">
and in includes/modules/payment/worldpay.php at lines 128 and 129 the code should be:
$callback_url = zen_href_link(FILENAME_WPCALLBACK, $zenId, 'SSL');
$worldpay_callback = explode('https://', $callback_url);
Sorry for any confusion my previous post on this may have caused.
Alan
New Zenner
This is where I have got to.
All systems striped back to STD (no SEO mod, All in HTTP mode) following recommended mods done
**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];}
if(isset($_POST['address'])) {$address = $_POST[address];}
if(isset($_POST['postcode'])) {$postcode = $_POST[postcode];}
if(isset($_POST['country'])) {$country = $_POST[country];}
if(isset($_POST['tel'])) {$tel = $_POST[tel];}
if(isset($_POST['email'])) {$email = $_POST[email];}
if(isset($_POST['authAmountString'])) {$authAmountString = $_POST[authAmountString];}
if(isset($_POST['cardType'])) {$cardType = $_POST[cardType];}
if(isset($_POST['testMode'])) {$testMode = $_POST[testMode];}
if($transStatus == "Y")
$worldpay_callback = explode('http://', $callback_url);
if ($testMode !== "0") {echo WP_TEST_HEADING . "<br /><br />";} x2
**
RESULT = CALLBACK FAIL (WP Cpanel callback disabled + callback fail counter +1) Emails as below
*Our systems have detected that your callback has failed.
This callback failure means we were unable to pass information
to your server about the following transaction:
Transaction ID: 236225406
Cart ID: d9b79c65698a6b7c9de440611f2d2f15
Installation ID: ******
Error reported: Callback to
http://www.bunnybasics.net/index.php?main_page=wpcallback&zenid=d9b79c65698a6b7c9de440611f2d2f15:
NOT OK, recevied HTTP status: 302
Server Reference: mggaeq4a:callbackFailureEmail-21248837:MerchReq-353
Also, if you usually return a response page for us to display to the Shopper
within the time allowed (1 minute), this will not have been displayed.
WorldPay will have displayed to the Shopper the response page file
(resultY.html or resultC.html) held for your installation on the WorldPay
server. This will be your own custom version, if you have supplied one, or,
if not, the WorldPay default version.
REQUEST.TXT File + RESPONCE.TXT attached
*
NEXT TEST
All above mods done with system is HTTPS mode
RESULT Callback fail stops at WP conf page (NO Counter +1 in WP CPANEL and NO E-mails) page output as below
This was NOT a live transaction - no money has changed hands Thank you, your payment was successful
Merchant's Reference: d9b79c65698a6b7c9de440611f2d2f15
WorldPay Transaction ID: 236226274
Please contact WorldPay immediately if there has been a problem making your payment.
NEXT TEST
**if($transStatus == "Y") set to ****if($transStatus == "")
RESULT SAME AS ABOVE, no increase in fail count, no e-mails ref fail
cart stops at select.worldpay.com with result below
**This was NOT a live transaction - no money has changed hands Thank you, your payment was successful
Merchant's Reference: c07d9e51794e58a133af01696089fe7d
WorldPay Transaction ID: 236228644
Please contact WorldPay immediately if there has been a problem making your payment.
Where do we now go from here?
Zen Follower
Have you got an URL where I can put through a test transaction to see what is happening - PM me if you would rather not post.
I did try on your site but the WorldPay module is not enabled at present. Perhaps you have a test site I can access.
The second set of test results shows that the callback is being successful.
As customer you should have got an email from both WorldPay and your store.
As Merchant you should also have received an email from both.
The order should also have appeared in Admin.
In /includes/templates/template_default/templates/tpl_wpcallback_default.php you should not change this code:
if($transStatus == "Y")
In /includes/modules/payment/worldpay.php for non-secure callback leave as is i.e. lines 128 and 129:
$callback_url = zen_href_link(FILENAME_WPCALLBACK, $zenId);
$worldpay_callback = explode('http://', $callback_url);
For secure callback these lines should be changed to:
$callback_url = zen_href_link(FILENAME_WPCALLBACK, $zenId, 'SSL');
$worldpay_callback = explode('https://', $callback_url);
Of course the setting for the callback URL in the WorldPay control panel should be either 'http://...' or 'https://...' as appropriate.
I think you are almost there so keep at it.
Alan
New Zenner
will have to leave this until tonight, as everythign is going wrong today. I will PM you
New Zenner
Duncan, I have now changed gateways as Worldpay was costing tooooo much to run, I have changed to Protx VSP Direct v2.0.0 and all worked right first time.
If you still want to use my system to debug/test that is cool I'll copy the shop to a new domain so you can play. Let me know
New Zenner
The module works really well thanks for the hard work.
I read earlier in this thread that you can not check the Worldpay transaction ID on the admin order page..
You explained that it would be necessary to change things such that the WorldPay Transaction ID is stored in the ZenCart database and displayed within the 'Orders' page in ZenCart Admin. A task for a future version of the WorldPay module.
Any idea if this is going to be implemented soon?
For now it would be handy to have the worldpay purchase transaction number for cross-reference in the subject line in the store cconfirmation e-mail.
Any idea how can I implement this ?
cheers,
Marco
Zen Follower
for PHP 5.2 people and error message see if this helps - thread
Zen Follower
I have installed worldpay and it is now in test mode.so far so good it was quite straightforward.I have read right through this thread and used the url for callback suggested too.The test works as customers end but stops on worldpay page, doesn't redirect back to site.
I receive an email from worldpay but no email from zencat and no record of any order shows up in my admin?
Anyone able to tell me where I am going wrong?
I am soooooooo near:blink:
Deceased
BlushFashions:
I have installed worldpay and it is now in test mode.so far so good it was quite straightforward.I have read right through this thread and used the url for callback suggested too.The test works as customers end but stops on worldpay page, doesn't redirect back to site.
I receive an email from worldpay but no email from zencat and no record of any order shows up in my admin?
Anyone able to tell me where I am going wrong?
I am soooooooo near:blink:
I have a client that is experiencing the same thing. Using ZC version 1.3.7(1) with all the latest patches.
He gets confirmation from WorldPay that an order/payment has been processed but does not receive an order confirmation from Zen Cart and there is no record of the order(s) (there is however a record of the item(s) in the shopping cart).
Any help on this is appreciated.
Zen Follower
Clyde,
To answer both yourself and the previous post from Blush Fashions let me first explain how the WorldPay callback works and interacts with ZenCart.
When a customer completes the checkout process they are passed to the WorldPay servers to complete the financial transaction. Once the customer has entered their credit card details WorldPay do a security check with the issuing bank and, if everything is OK they payment is deducted from the customers card account. At this point the callback kicks in and WorldPay tries to run the callback script within the ZenCart WorldPay module.
If this runs OK then basically the order is processed within Zencart. All the items in the customer cart are added to a new order, the customer cart is emptied and the new order appears within the ZenCart Admin. The customer sees the Zenncart 'Checkout Success' screen. Both WorldPay and ZenCart send emails to the customer and merchant confirming the transaction.
If the callback fails for any reason the customer is directed to a WorldPay 'Success' page (which can be customised) and the customer and merchant receive an email from WorldPay. However, since the callback has failed, ie the callback script has not run, the order is not created within Zencart, the customer cart will still contain the items the customer has tried to order and no emails will be sent by Zencart.
This is what appears to be happening at both the Blush Fashions and Mystic Mountain Naturals website.
Why is it happening? There are two reasons why this may be happening.
The first is that the callback url is not available (or doesn't respond quickly enough) when WorldPay initiates the callback. I have tried accessing the Mystic Mountain Naturals website several times this afternoon and it responds very very slowly. I suspect this may be the problem here.
The second is that some hosts appear to use some form of re-direct to point to domains hosted on their servers. I'm no expert on the various configuration options of webservers but usually when someone reports a callback failure they also report a 're-direct' error being reported by WorldPay. For security reasons WorldPay do not allow any form of re-direct within the callback script. If this is the case you will need to contact your host and ask them to remove any re-directs associated with your domain.
Seems like a bit of a cop out but I'm afraid what the above boils down to is that it is a hosting problem. Either the server is too slow or the configuration is not compatible with WorldPay. What I will say is that I have several customers who have been using Zencart and the WorldPay module, hosted on my server, for several years now (over 3000 transactions) and I have only experienced one callback failure in that time. I can't be sure but I think on that occassion the customer took so long processing the transaction (they may have been distracted) with WorldPay that their Zencart login session had timed out and was no longer valid.
I hope this helps. Please post back here if/when you get this issue resolved.
Regards,
Alan
Deceased
duncanad:
Clyde,
To answer both yourself and the previous post from Blush Fashions let me first explain how the WorldPay callback works and interacts with ZenCart.
When a customer completes the checkout process they are passed to the WorldPay servers to complete the financial transaction. Once the customer has entered their credit card details WorldPay do a security check with the issuing bank and, if everything is OK they payment is deducted from the customers card account. At this point the callback kicks in and WorldPay tries to run the callback script within the ZenCart WorldPay module.
If this runs OK then basically the order is processed within Zencart. All the items in the customer cart are added to a new order, the customer cart is emptied and the new order appears within the ZenCart Admin. The customer sees the Zenncart 'Checkout Success' screen. Both WorldPay and ZenCart send emails to the customer and merchant confirming the transaction.
If the callback fails for any reason the customer is directed to a WorldPay 'Success' page (which can be customised) and the customer and merchant receive an email from WorldPay. However, since the callback has failed, ie the callback script has not run, the order is not created within Zencart, the customer cart will still contain the items the customer has tried to order and no emails will be sent by Zencart.
This is what appears to be happening at both the Blush Fashions and Mystic Mountain Naturals website.
Why is it happening? There are two reasons why this may be happening.
The first is that the callback url is not available (or doesn't respond quickly enough) when WorldPay initiates the callback. I have tried accessing the Mystic Mountain Naturals website several times this afternoon and it responds very very slowly. I suspect this may be the problem here.
The second is that some hosts appear to use some form of re-direct to point to domains hosted on their servers. I'm no expert on the various configuration options of webservers but usually when someone reports a callback failure they also report a 're-direct' error being reported by WorldPay. For security reasons WorldPay do not allow any form of re-direct within the callback script. If this is the case you will need to contact your host and ask them to remove any re-directs associated with your domain.
Seems like a bit of a cop out but I'm afraid what the above boils down to is that it is a hosting problem. Either the server is too slow or the configuration is not compatible with WorldPay. What I will say is that I have several customers who have been using Zencart and the WorldPay module, hosted on my server, for several years now (over 3000 transactions) and I have only experienced one callback failure in that time. I can't be sure but I think on that occassion the customer took so long processing the transaction (they may have been distracted) with WorldPay that their Zencart login session had timed out and was no longer valid.
I hope this helps. Please post back here if/when you get this issue resolved.
Regards,
Alan
Thanks, Alan.
As I said in my last PM the actual site is http://www.ihdvd.com/.
I'll have the client check with his hosting company about any re-directs they may have in place.
Again Thanks and I'll let you know if we get the issue resolved.
Deceased
clydejones:
Thanks, Alan.
As I said in my last PM the actual site is http://www.ihdvd.com/.
I'll have the client check with his hosting company about any re-directs they may have in place.
Again Thanks and I'll let you know if we get the issue resolved.
Alan,
Thanks again for the information.
I passed everything along to the client and he just informed me that he hadn't enabled the call back in the WorldPay control panel but had now done so.
So I'm hoping that that was the problem and it is now resolved.
I'll let you know.
Best regards.
New Zenner
Until yesterday everthing was working fine on our latest Zen Cart 1.3.7 shop but since yesterday I also do not get anymore order confirmation e-mails from Zen Cart when an order has been successfully paid through Worldpay.
Users can place an order and go through the Worldpay payment pages flawlessly but when they return to our site an error appears:
Warning: Cannot modify header information - headers already sent by (output started at /home/template_default/public_html/webstore/includes/templates/template_default/common/html_header.php:22) in /home/template_default/public_html/webstore/includes/functions/functions_general.php on line 46
I looked up the problem on 'headers already sent' on the wiki and it said this warning is often caused by a blank space or extra line at the beginning or end of a .php file OR a syntax error or the result of an "echo()" statement
So I checked the html_header.php on line 22 (which I have not changed at all over the last months) :
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>> It seems that the echo() statements are giving problems and therefore not confirming the Zen Cart transactions that were successfully paid through Worldpay. Can you help me to solve this?Fields marked required must be completed.
Tell staff why this post should be reviewed.