Totally Zenned
- Join Date:
- Oct 2004
- Location:
- Southport, UK
- Posts:
- 3,644
- Plugin Contributions:
- 6
WorldPay Module version 2.0 - Support thread
Thanks for that Philip - much appreciated
Rick
Views: 215,936
Totally Zenned
Thanks for that Philip - much appreciated
Rick
New Zenner
Hi Everyone,
I am new to Zencart and enjoy the colloborative sharing that goes into this product.
In that spirit, I have created a slight modification to Philips great addon to allow the user to pick a credit card type before sending the order to Worldpay (See attached screenshot).
As you all know, the more screens the user has to enter information, the less likely he/she is to buy so this at least eliminates one screen (assuming you only want to accept payment in one currency)
There are only two files to change:
File#1
LOOK for the first line in the snippet below then add everything after <!-- BOF Draw CC dropdown box -->
NOTE: This assumes that Worldpay is the FIRST payment module in your sort order. If not then change the value of $i (see comments)
<label for="pmt-<?php echo $selection[$i]['id']; ?>" class="radioButtonLabel"><?php echo $selection[$i]['module']; ?></label>
<!-- BOF Draw CC dropdown box -->
<?php
//This assumes that the Worldpay is your FIRST in your sort order in the ADMIN > Payment > Modules
//If not then change the value of $i to match where in the order you want it
if ($i==0)
{
//Create the array of credit cards as per Worldpay documentation
$cc1[] = array('id' => 'VISA', 'text' => 'Visa');
$cc1[] = array('id' => 'MSCD', 'text' => 'MasterCard');
echo zen_draw_pull_down_menu("paymentType", $cc1,'','','');
}
?>
<!-- EOF Draw CC dropdown box -->
File#2
There are two spots you need to add code.
$OrderAmt = number_format($order->info['total'] * $currencies->get_value($currency), $currencies->get_decimal_places($currency), '.', '') ;
//**************************************
// Credit card Drop down
//**************************************
//Get the CC type
$CCpaymentType = $_POST["paymentType"];
//**************************************
zen_draw_hidden_field('currency', $currency) .
//**************************************
// Credit card Drop down
//**************************************
zen_draw_hidden_field('paymentType', $CCpaymentType) .
And that's basically it. You can add more cards by adding it to the array.
Now please bear in mind I am new to Zencart and relatively new to PHP, but I do have 25+ years in coding so I am not completely green but it doesnt mean I couldnt have overlooked something. So go easy on me. But so far it appears to work as planned.
Hopefully Philip will include this in his new version. His work has saved me a lot of time, so thanks Philip!
Suspended
There is a "small problem" not all merchant are authorised to take all credit or debit cards, e.g. USA people don't do maestro I believe, not what could be a better way is to incorporate the above code but to make it so that the shop owner selects which card types they do accept from a list in the admin sections by ticking the boxes. I can't find the paymentType parameter in the worldpay documentation either. Here:
http://www.worldpay.com/support/kb/mergedProjects/htmlredirect/rhtml5902.html
although it is documented here
http://www.worldpay.com/support/kb/mergedProjects/customisingadvanced/custa9102.html
so good spotting, that also then gives me an entire list of possible options and it does mention that which I wrote above:
Note that you may need to modify this HTML fragment, so that it displays only the payment methods that our Payment Service can accept for your installation.
so integrating your code with an admin selectable list would work and I'll schedule it in for the next release.
Philip.
New Zenner
Yes, I agree that putting it the admin would probably be best. I was looking for someone quick and easy, so hence adding it to the payment template.
As a Canadian, we too cannot take a lot of those cards which is why I wanted to limit it to Visa and Mastercard. As you stated, you can add whatever card you like as per the Worldpay documentation.
Since I have your ear, do you have any idea why I would get a "This page contains both secure and nonsecure items" when my callback page is called?
Since I am not using SSL (yet), I put the url in Worldpay as http://<wpdisplay item="MC_callback"> as per the install text.
I did notice the resultant url is:
https://select-test.worldpay.com/wcc/card?xxxxx
Is there something I am missing in the config?
Thanks,
Khalil
Suspended
Nothing missing in the config, the error is browser generated because your images or style sheets that are linked into the secure "worldpay page" URI are not coming from an SSL server so IE flags it up because the main paige URL is SSL.
I'll incorperate those mods as they do seem like a good idea, I'm a fan of speeding up the shopping process and was asked recently if there was a way of doing a shop where the user would not be requried to create an account. The answer to that question is "no" at the moment because of the way worldpay tries to re-establish a session to mark the item as paid, in theory a temporary "guest" cart could be created then when the user fills in the details at worldpay, the information sent back could be joined to the "guest" cart and then create a new user, then an order, but it's a lot of work as worldpay does need a different templating system to that which ZC already uses.
Philip.
New Zenner
Hi - I've fallen at the first post when trying to install the WorldPay module in Admin. When I click to Install I get the following error message:
1364 Field 'configuration_title' doesn't have a default value
in:
[REPLACE INTO configuration (configuration_key, configuration_value, configuration_group_id, date_added) VALUES ('MODULE_PAYMENT_WORLDPAY_VERSION', '2.04', '6', now())]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
Any help appreciated
PS I also noticed that the payment module name (in Payment Modules in Admin) says it's version 2.04 even though I downloaded v2.05. Is this relevant/does it matter?
Thanks!
Suspended
Hmm now that's interesting you appear to have a very strict version of mysql. in your admin section go onto tools > install SQL patches and enter
ALTER TABLE configuration MODIFY COLUMN configuration_title text DEFAULT NULL;
in the Enter the query
to be executed: box, and that should sort that out, BUT it's not a worldpay problem per se that's a problem with your setup and zen cart in general and I'm rather surprised that things haven't fallen to pieces in other places.
And yes, I know about the 2.04 problem, it's been fixed for 2.06 which comes out this week.
Suspended
Oh and you may also have to enter
delete from configuration where configuration_key like 'MODULE_PAYMENT_WORLDPAY%';
into that SQL box to clear all the worldpay values out, sine it may have half installed.
New Zenner
Philip - thanks for your lightning quick response.
Have done as you said (had to do it for some other fields as well) and all is well now. THANK YOU :)
Suspended
Erm, unless you knew what column types that were set in the original table creation, you probably shouldn't have modified any columns as they could have been varchar, float or int. If you need to please PM me to confirm the column types of the values you have changed.
Philip.
Suspended
New version 2.06 has been released details below. Please read the section http://YOUR_SERVER/docs/worldpay/ very carefully after installation.
New Function, possible bug fixes
5th March 2009
Bug fix, on heavily overloaded servers the variable credit_covers appears to be being set, this then allows the buyer to go through to worldpay but the when they return it has removed their shopping cart as if they had a gift voucher or special discount. This "bug" has been fixed although it is why it happens (and it is a zen-cart thing outside of the worldpay module) is outstanding
Forum user Khalil suggested some code and an idea to select the credit/ debit cards before going to worldpay, so skipping one of those ugly screens, it was a very good one and has been incorporated although in a slightly different format. Khalil's idea was to modify the templates to put in a select box. The "select box" option still exists and looks neater, but the user would only know what credit cards were accepted if he/she clicked the box. An additional Radio Button layout has been added so that the user can clearly see the accepted cards (which means Khalil's idea was even better as showing the correct accepted ards on the confirmation screen saves the user going to worldpay and finding his/ her card isn't accepted). Also the templates do not have to modified to use now use this options, it is select in admin, as are the cards that are accepted, so there is no editing of PHP pages required.
If you have applied Khalil's modification to the checkout template, you will have to remove it
The file has been submitted to Zen cart but you can get the same copy from
http://exploitingit.co.uk/WorldPay_ZC1.3.x_v2.06.zip
until Zencart put it up on their downloads page.
Zen Follower
Hi,
As i'm sure you're aware, Worldpay are changing at the end of this month. I think the extent of the changes for most users will be the worldpay url needs to be changed. Do you know anything about this?
Thanks
Suspended
Yes several people have mentioned it and forwarded the notification. I assume as worldpay is owned by RBS that is now majority owned by our government, they are pooling their resources in an efficiency drive. The memo looks to me like they are either going to
change the domain name where the info is sent (bad idea, this forum will be filled with 100's of people),
but more likely
change from where the computer posts a successful transaction.
I am guessing that some shops limit the posting of data to ip range (it is possible) but we don't so that won't affect us.
What will affect is that with version 2.0 of ZC on the horizon, the whole module will have to be re-programmed.
Chink chink anyone (that's the sound of me rattling a bucket for donations).
Philip.
New Zenner
Hi,
I have WorldPay 2.06 installed and am trying out some test transactions before I go live. I've just carried out a test transaction and whilst the payment seems to have gone through OK (have checked via WorldPay admin screens) I wasn't redirected back to my site at the end of the transaction and I don't have anything showing up on the Payment response page.
I'm sure I'm doing something really dumb but not sure what.
Thank you.
Suspended
Have you turned on the debug emails ?
The queickest way to test a return is to go through and not pay but hit "cancel" and that should return you, then you don't have to go through the bother of actually paying.
Common reasons for not being redirected back include not hanve clicked the save settings at the bottom of the WorldPay screen when setting up your account. Not having transferred the details from the test account to your live world pay account (this does happen sometimes), not having set a payment repsonse password or having got it wrong. Sometimes worldpay can take ten minutes to update it's passwords it sends out, as there appears to be some sort of caching going on at their end.
Philip.
New Zenner
Thanks Philip - yes it was indeed a password problem. For some reason WorldPay admin was not saving my payment response password (database error message appeared, then WorldPay test server went down completely into maintenance mode). Anyhow, everything seems to be up and running now on the WorldPay side, I successfully saved a password and WorldPay is successfully redirecting to my site! Hurray.
Many thanks.
New Zenner
Hi
Have WorldPay 2.06 installed and am having a problem with the redirect to my site. Have read every post in this thread and know I must be missing something simple.
Initially I had a password problem but that seems to have gone as now I'm only getting Transaction Status Success debug emails from my own server. The WorldPay Callback Failure Alerts are always NOT OK, recevied HTTP status: 302.
Any ideas?
Suspended
That sounds interesting, that's a redirect that has appeared further down the chain than the password check. Since you get the success email then a) worldpay is talking to the server, b) the password is correct.
So have you checked if you have suhosin installed on the server (in admin > modules > payment > worldpay) it should tell you.
What happens if you put something in your cart, do all the select shipping things and then cancel in worldpay before you "pay" do you get back to the site with a cancellation message or are you re-directed to a login screen to re-establish the session. The most likely cause for a 302 is that your site has not re-established the session when worldpay sent through the details. "OR" and I have seen this once before, sometimes the website doesn't store the payment method in the session and it re-establishes the sessions then goes, oops not payment method and throws worldpay back to a login screen. As yet the cause of this one is unknown, the site it was seen on was a very busy one, so if suhosin is not causing the problems then I'd like to see the site (PM) me, to try and get to the bottom of it.
Philip.
Suspended
The above problem was solved earlier on today, it was not a worldpay bug, it was a session configuration idosyncracy.
For wordpay to work sessions should be configured in admin (admin > configuration > sessions) as follows
Force Cookie Use False
Check SSL Session ID False
Check User Agent False
Check IP Address False
because worldpay tries to re-establish the session to mark up the orders as paid. Worldpay doesn't use cookies, it is connecting through a differeing SSL connection, it connects a a browser that identifies itself as a java object and from a different ip address to the user's shopping cart, so any one of these items set to true will cause a session to collapse and although worldpay will take the money, the order will remain marked up as unpaid.
Attached is an image showing the correct configuration.
Philip.
New Zenner
zencart 1.3.8
worldpay payment module 2.0.4
simple seo url
The worldpay installation test area does not hold most of the details I give it. The following do record:
description
customer description
store builder used / other
enable recurring payment response
enable shopper response
payment response failure email address
payment response password
md5 secret for transactions
since the test page does not record the payment response url I am not getting beyond the authorised payment / thanks page on worldpay. no errors are recorded, but worldpay is not recording the test transactions either.
I spoke to technical support at worldpay and was told that the test area setup isn't supposed to record the payment response url etc as once the ability to process a payment is complete, the response can be checked using a minimal live payment in the production area... This seems like a crazy situation to me if it is correct. Can anyone else confirm/deny it's accuracy?
Transactions record in the worldpay test area, but I can't test the full work flow. I am stumped and don't want to have to change store item prices, shipping costs etc in order to do cheap live tests...
Any help gratefully received!
Jim :lamo:
Fields marked required must be completed.
Tell staff why this post should be reviewed.