Zen Cart Logo
Forums / Addon Payment Modules / WorldPay Module version 2.0 - Support thread

WorldPay Module version 2.0 - Support thread

Locked

Views: 215,936

Results 101 to 120 of 738
This thread is locked. New replies are disabled.
5 Feb 2009, 10:49 PM
#101
philip_clarke avatar

philip_clarke

Suspended

Join Date:
Sep 2008
Posts:
608
Plugin Contributions:
3

WorldPay Module version 2.0 - Support thread

Just clarify, did you add something to one of the defines like PAYMENT_METHOD_DETAIL or something, to put the image in ?

5 Feb 2009, 11:41 PM
#102
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: WorldPay Module version 2.0 - Support thread

That would help huh LOL

I added the code into includes/languages/english/modules/payment/worldpay.php

define('MODULE_PAYMENT_WORLDPAY_TEXT_TITLE', '<img src="https://select.worldpay.com/jsp/shopper/pictures/poweredByWorldPay.gif" alt="WorldPay" /><br />      Credit Card via WorldPay');
5 Feb 2009, 11:59 PM
#103
philip_clarke avatar

philip_clarke

Suspended

Join Date:
Sep 2008
Posts:
608
Plugin Contributions:
3

Re: WorldPay Module version 2.0 - Support thread

I am buggered if I can find a cunning way of doing it, but the simple way if for you to edit

/email/email_template_wp_callback.html

there's all kinds of variables in there so after each one put (a) (b) (c) do a test order, look at the email to work out which variable was affected and then replace it. so if it is $PAYMENT_METHOD_DETAIL being replaced by your constant MODULE_PAYMENT_WORLDPAY_TEXT_TITLE then you just remove $PAYMENT_METHOD...

The automatic emailing sytem in includes/classes/orders.php which would involve a lot of editing of code, when the easy way is just to replace the section in the email template with whatever you want.

Philip.

6 Feb 2009, 12:46 AM
#104
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: WorldPay Module version 2.0 - Support thread

I'm trying to understand that, but I'm a bit lost even contemplating it LOL

The code in includes/modules/payment/worldpay.php that calls the define MODULE_PAYMENT_WORLDPAY_TEXT_TITLE is this section here on Line 54:

      $this->title =  (IS_ADMIN_FLAG === true) ? MODULE_PAYMENT_WORLDPAY_TEXT_ADMIN_DESCRIPTION.' v'.$this->moduleVersion .( (MODULE_PAYMENT_WORLDPAY_TEST_MODE != 0) ? ' <b style="color:red">(Test Mode activated)</b>' : '') : MODULE_PAYMENT_WORLDPAY_TEXT_TITLE;
      $this->enabled = ((MODULE_PAYMENT_WORLDPAY_STATUS == 'True') ? true : false);
```I was wondering if I can add in an extra constant I create in the language file for the image, say MODULE_PAYMENT_WORLDPAY_IMG for example somewhere before MODULE_PAYMENT_WORLDPAY_TEXT_TITLE in that code? Is that possible?

As you can see I am very very new to php and not overly sure what I am doing most of the time LOL
6 Feb 2009, 1:18 AM
#105
philip_clarke avatar

philip_clarke

Suspended

Join Date:
Sep 2008
Posts:
608
Plugin Contributions:
3

Re: WorldPay Module version 2.0 - Support thread

Ok you are not bad in that you hae the right constant and location but you don't get the big picture. An entirely diffferent part of zencart after an order is successfully makred as paid, starts working on the tables, it pulls the constant through from the worldpay module and embeds it in the "order", in a single static row in a table that is saved for all time (that's hwo it's supposed to work). Now when it does this, it happens to pull the email template, does a quick search and replace and sends out the html, from the same information.

So if you created a new constant then you would have two options, either a) start playing with the module to get it to send out the new constant only after the order was successful, or b) start playing with the core of zencart and telling it to ignore what it normally does and change the constant in the email.

The third way is what I suggested, edit the template for the emails that goes out. The template is a basic seearch & replace with information from the core of zencart, so you can write "I'm a blue monkey" in there and it will go out just as you wrote it. Things in Capitals with a $ in in front of them get replaced by zencart so you need to locate the $VARIABLE that shows your image, and just put "Paid by Worldpay" in it's place, so just mark up each section of the email template with letters or numbers so that when you put a test order through, you can work out which bit to change. I'd do this but I don't have a worldpay account (yes I know that I run the module and it's just weird, but it's also true) and I haven't got a spare demo site set up (which takes a couple of hours) when it's faster that you send yourself an email.

It's a worldpay only template so won't affect any other users or processes, so you find the file,

/email/email_template_wp_callback.html

mark it up with numbers so that you can locate which variable to replace, and remove the sentence "I'm a blue monkey" before going "live".

Philip.

6 Feb 2009, 1:29 AM
#106
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: WorldPay Module version 2.0 - Support thread

Ok, I think I am getting closer to understanding this LOL and I believe the variable that needs changing is $PAYMENT_METHOD_DETAIL, what I don't know...or understand...is where this variable is 'defined' or written to change it, I tried looking it up in the developer's toolkit and it can't find it lol, so I think I am not understanding how or where to change that variable.

**edited in to add that I can find the variable without the $ in includes/classes/orders.php:

    $html_msg['PAYMENT_METHOD_DETAIL'] = (is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->title : PAYMENT_METHOD_GV );
```but I really don't wanna screw up the file by mucking around with what I don't know LOL

BTW I read earlier in the thread how you'd applied for a test account with WP and I think they really should give you one considering how much work you've put into enabling their customers to increase their money for them lol
6 Feb 2009, 1:42 AM
#107
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: WorldPay Module version 2.0 - Support thread

Mulling over this....lol

Would the correct way to change this be to in includes/classes/orders.php add the following in red below:

    $html_msg['PAYMENT_METHOD_DETAIL'] = (is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->title : PAYMENT_METHOD_GV );
    $html_msg['PAYMENT_METHOD_DETAIL_WP']  = EMAIL_TEXT_PAYMENT_METHOD_DETAIL_WP;
```Then in includes/languages/english/wp_callback.php add the follwing define:

define('EMAIL_TEXT_PAYMENT_METHOD_DETAIL_WP', 'Credit Card Via Worldpay');


$PAYMENT_METHOD_DETAIL


$PAYMENT_METHOD_DETAIL_WP

6 Feb 2009, 2:00 AM
#108
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: WorldPay Module version 2.0 - Support thread

Oo I am making this harder on myself than it has to be aren't I? I have read and re-read your reply and you literally mean to replace $PAYMENT_METHOD_DETAIL in the email template with Credit Card Via Worldpay ? :blush: :oops:

6 Feb 2009, 2:37 AM
#109
philip_clarke avatar

philip_clarke

Suspended

Join Date:
Sep 2008
Posts:
608
Plugin Contributions:
3

Re: WorldPay Module version 2.0 - Support thread

Spot on, just rip the variable out of the template and plonk in whatever you want. Keep it Simple not so stupid, as you've done very very well in searching around in the bowels of zen cart, It's probably and anglo-australian misunderstanding. Find the template, test it for the place you want your new thing and then replace the variable in the file, not elsewhere.

As for worldpay, who really knows and understands their logic, they have a clearly published set of developer guidelines, but no testing mechanism unless you pay for a merchant account, and I only inherited this module when I broke it. There's supposed to be an affiliate reommend system too, and I haven't got that either, the only reason I know is that every so often somone comes along here and spams the forum. I rely on people trusting me enough to give me access to their merchant accounts just to run this and with ZC 2.0 around the corner, everything will stop working.

6 Feb 2009, 2:49 AM
#110
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: WorldPay Module version 2.0 - Support thread

Well, you know we are an upside down backward lot down here LOL add in blonde DNA to the mix and there's bound to be trouble :P

You ever need to test with a merchant account gimme a holler, I really don't make enough worth stealing at the moment ROFLMAO and I would trust you anyways ;)

13 Feb 2009, 12:46 AM
#111
evenangelsdie avatar

evenangelsdie

New Zenner

Join Date:
Oct 2008
Posts:
31
Plugin Contributions:
0

Re: WorldPay Module version 2.0 - Support thread

hey all,
I'm having the worst time trying to get this module to work with my store. like the person on page 10, i have just been approved by worldpay and have a brand new account. i've followed all of the instructions on here and triple-checked everything but what am i missing!?

I cannot get the orders to go through. After entering the CC details in my checkout i am directed to the ugly Worldpay success page saying my payment has been submitted. It doesn't redirect back to my store, and the orders from my store don't get emailed to me. The only emails I receive are the default success ones from Worldpay. I have debugging on and get those emails, but I cannot find any errors in them!!!!

I noticed in the tutorial it said to put the callback url in the "callback url" box.. but there isnt one in worldpay, theres the Payment Response URL which I assume is the same thing... ? I have this in that box:
http://<wpdisplay item="MC_callback"> (no S since my site isnt SSL).

What could be wrong with this darn thing?!

13 Feb 2009, 12:54 AM
#112
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: WorldPay Module version 2.0 - Support thread

Have you entered all the necessary details in BOTH the test environment and the production environment? Cos that is what my mistake was, I hadn't put all the same details into the test environment settings lol

13 Feb 2009, 12:57 AM
#113
evenangelsdie avatar

evenangelsdie

New Zenner

Join Date:
Oct 2008
Posts:
31
Plugin Contributions:
0

Re: WorldPay Module version 2.0 - Support thread

Yes I have. I just noticed that in my zen admin, under the worldpay module it says
Warning: Session encryption is enabled in store.
Additional: session encryption is enabled in admin area

what does that mean!?!

13 Feb 2009, 1:06 AM
#114
evenangelsdie avatar

evenangelsdie

New Zenner

Join Date:
Oct 2008
Posts:
31
Plugin Contributions:
0

Re: WorldPay Module version 2.0 - Support thread

Also just noticed my settings aren't saving in Worldpay's admin!! Enable the Shopper Response keeps unchecking itself. also, every time I copy to Production and save then go back to check the settings they're all defaulted again!

13 Feb 2009, 1:52 AM
#115
philip_clarke avatar

philip_clarke

Suspended

Join Date:
Sep 2008
Posts:
608
Plugin Contributions:
3

Re: WorldPay Module version 2.0 - Support thread

It means you have to disable suhosin by following the instructions, which are here:

http://www.zen-cart.com/forum/showthread.php?t=110204

where you either add a line to php.ini or to .htaccess depending on your server's set up.

13 Feb 2009, 2:11 AM
#116
evenangelsdie avatar

evenangelsdie

New Zenner

Join Date:
Oct 2008
Posts:
31
Plugin Contributions:
0

Re: WorldPay Module version 2.0 - Support thread

Thank you I got that warning to go away by doing what you suggested. I am still having problems with the other stuff though.

13 Feb 2009, 2:22 AM
#117
evenangelsdie avatar

evenangelsdie

New Zenner

Join Date:
Oct 2008
Posts:
31
Plugin Contributions:
0

Re: WorldPay Module version 2.0 - Support thread

Well I got it to work! I cleared the contents of the test and production installations in worldpay and re-entered them and voila!

13 Feb 2009, 2:29 AM
#118
philip_clarke avatar

philip_clarke

Suspended

Join Date:
Sep 2008
Posts:
608
Plugin Contributions:
3

Re: WorldPay Module version 2.0 - Support thread

I've mentioned it before,WorldPay does appear to have a caching mechanism so sometimes thing do not change immediately, I always suggest a cup of tea.

19 Feb 2009, 2:13 PM
#119
ryk avatar

ryk

Totally Zenned

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

Re: WorldPay Module version 2.0 - Support thread

We have a client complaining that Google Analytics is ignoring sales via Worldpay, but tracking those via Paypal IPN. Has anyone else had this problem - and if so, is there a solution?

Both the modules have been installed correctly (or so we believe!)

20 Feb 2009, 12:51 PM
#120
philip_clarke avatar

philip_clarke

Suspended

Join Date:
Sep 2008
Posts:
608
Plugin Contributions:
3

Re: WorldPay Module version 2.0 - Support thread

Clients huh ? There is no interface at all for google analytics and worldpay, and the paypal IPN is not really "tracking sales". The only way that analytics could track sales would be by setting a cookie on the checkout process/ checkout success sales pages unless paypal allowed an analytics box inside it's secure payment area. There is no reason why analytics would not work with the worldpay module, the analytics module may provide differing checkout pages, and these could be modified and copied to the worldpay templates.

Brief explanation into the technical bits

Worldpay has a different checkout success page to the rest of zen-cart because it receives a password from worldpay and is then pulled into the worldpay website where worldpay then re-writes the page and puts the transaction number and success or fail. The page pulled in, is just the same as zen-cart's normal templates but has one tag inserted so that worldpay can put it's markup in. To get the analytics module to work would require adding the code to the pulled through page, BUT this would rely on worldpay allowing analytics to set cookies or have unique identifiers, might work, might not, have to suck it and see. Not complex at all to do, but a successful worldpay transaction has a zencart shop page displayed at a worldpay url and it's not a redirect.