Re: WorldPay Module for ZenCartv1.3x
Jamie,
Our posts have just crossed.
You are quite right the transaction ID is created by WorldPay not by Zencart. WorldPay are nearly correct in that most of the data sent in the WorldPay response is a return of the data sent in the purchase token.
Regards,
Alan
Re: WorldPay Module for ZenCartv1.3x
Thanks for your help Alan.
The difficulty is that from within the WorldPay Admin area there seems to be no reference to which store made the sale and then when we view a sale in Zen-Admin we get to only see our Zen Order Number.
We'll keep thinking...... ;)
Thanks once again
Re: WorldPay Module for ZenCartv1.3x
Jamie,
I'm sorry but I'm a bit confused.
What I understood from your previous posts was that you have three stores ie three separate ZenCart installations all accessing the one WorldPay account for payment processing. No problem with that. A purchase transaction originated from Store 1 will be passed back to Store 1 by WorldPay. A purchase transaction originated at Store 2 will be passed back to Store 2 and Store 3 to Store 3. Each store admin will only display data for orders originated in that store. I can see why you would want identifiable order numbers so that you know which installation to go to check details, but within each store admin there is no dubiety as to where any orders listed originated.
Now I get a sense that what you have is three stores all residing within a single Zencart installation - or perhaps sharing a single database which is a totally different ballgame.
Could you please explain the exact configuration of your three stores.
Regards,
Alan
Re: WorldPay Module for ZenCartv1.3x
Hi Alan,
Sometimes it's good to talk ;) - having re-read our posting I may of confused you.
You are correct the 1st time, we have 3 different stores which all use the same WorldPay account.
If we log into Worldpay we have difficulty seeing which store made the purchase as we are just shown a list of "Mechant Reference = SESSION_ID" sales.
We therefore, ideally, would like to pass over a Reference to help use identify a) the store and b) the sale.
Ideally this would be
ABC+Order ID
so we can then relate the Zen-Cart Admin Sale with the WorldPay list of sales.
Hope that is a little clearer ;-) Thanks for all your help so far..
Thanks
Jamie
Re: WorldPay Module for ZenCartv1.3x
Jamie,
I think I have found a simple solution to at least the WorldPay end of the problem.
Log in to your WorldPay account.
Click on 'Get Statement'.
Scroll down until you see 'Statement Configuration'
Click on 'Design Your Statement'
Click on 'New'.
At the top in the 'Column Configuration Name' field enter a name for your statement e.g. 'Custom Statement'
Choose which fields you wish to appear in your statement by choosing a column number from the dropdown lists adjacent to each field. Make sure you assign a column number to the 'Description' field. The column numbers determine the order in which the data is displayed.
Save your configuration by clicking 'Save Configuration' at the bottom.
Go to the bottom of the page again and click 'Back to Statement Request'.
In the 'Statement Request' page select 'Custom Statement' from the 'Column Configuration' drop down list.
Now click 'View Statement'.
You will now see all of the fields you have chosen to include in your custom statement. The description field will contain 'Purchase from "Your Store Name"' where "Your Store Name" will be the name of the initiating store as set up in your store admin - Configuration>My Store>Store Name.
This solves the problem of identifying which transactions have been initiated by which store in your WorldPay statement. It does not solve the problem of which transaction corresponds to which ZenCart Order number. For this it will be necessary to change things such that the WorldPay Transaction ID is stored in the ZenCart database and displayed within the 'Orders' screens in ZenCart Admin. A task for a future version of the WorldPay module. perhaps.
Hope this helps.
Regards,
Alan
Re: WorldPay Module for ZenCartv1.3x
Hi Alan,
Im back, sorry about the delay:
***removed humongus screenshot***
Looking at the PHP code comparing for NOT 0 running is confusing me! Is it maybe because the 0 has no quotes around it and is a string and not an integer?
I doubt it as it would have flagged on loads of other systems before now.
Kind regards,
Rikki
Re: WorldPay Module for ZenCartv1.3x
Rikki,
What you have just proved by adding my little snippet of code is that WorldPay are returning the correct value for 'Test Mode' for a live site ie '0'. So the problem is NOT at the WorldPay end.
I suspect you must have made an unintentional change to the code in
includes/templates/template_default/templates/tpl_wpcallback_default.php
line 208 should look exactly like this:
Code:
if ($testMode !== 0) {echo WP_TEST_HEADING . "<br /><br />";}
The syntax is as follows:
If the condition defined within the normal brackets is met then do whatever action is defined within the curly brackets.
The condition here is ($testMade !== 0) which basically means $testMode is NOT equal to '0'.
The action if this condition is met is to display the WP_TEST_HEADING text as defined in the language file.
You have just proved that $testMode does equal '0'. This is the only value that should result in the WP_TEST_HEADING text NOT being displayed so there must be something wrong with the syntax of this line of code. Check it very carefully. It should be exactly as shown above.
Regards,
Alan
Re: WorldPay Module for ZenCartv1.3x
Here is the file, I had not altered it until you showed me how to display the text above.
http://www.kraftybitz.co.uk/tpl_wpca...efault.php.txt
I've copied it and renamed the copy .txt so you can see it.
Many thanks,
Rikki
Re: WorldPay Module for ZenCartv1.3x
Rikki,
I'm really quite baffled by this one. Your template file is identical to mine and I don't get your problem.
The only other thing I can think of is that there is something a bit awry with your language file.
Could you let me have a look at your includes/languages/english/wpcallback.php file?
Regards,
Alan
Re: WorldPay Module for ZenCartv1.3x
I thought the same when I viewed the code!
Couldnt be a weird PHP versioning issue with global registers, or string/integer mismatch comparison? eg: ($variable !== "0")
Here is the other file you requested in TXT format.
http://www.kraftybitz.co.uk/wpcallback.php.txt
Many thanks,
Rikki
PS: Ive dropped you a PM.