Jump to content
Sign in to follow this  
scottymcloo

Worldpay 4.0 - Version 1.0

Recommended Posts

I've installed and tested the WorldPay module (v1.3) on and osC-release from 30.jan 2003.

 

It seems to run fine, I get back to the callback page but when I click continue it returns me to the osC login-screen (I've been logged out somehow). Cart still containt the items bought, and order-history is empty.

 

Anyone experienced this and got a solution?

Share this post


Link to post
Share on other sites

Hmm....I tried turning off SSL and now it seems to work...but not entirely correct:

 

After I enter the credit-card info etc. at WorldPay and click to return to osC it says payment was successfull but I'm not logged in. When I click continue the order is confirmed and I'm logged in...weird but it seems to work...

 

Is this a common problem with using SSL?

Share this post


Link to post
Share on other sites

Hi

 

Why are you using SSL? Worldpay uses SSL for the credit card acceptance, and therefore all transactions are secured by Worldpay. I have not seen this problem before. What snapshot are you using?

 

Graeme

Share this post


Link to post
Share on other sites

As written above I'm using the snapshot from 20030130.

 

Also found another problem now, but I think that is because of another contribution i tried installing. When I use AutoLogon 1.03 it just logs out after returning from the worldpay-form. Guess I will have to do without autologon enabled :P

Share this post


Link to post
Share on other sites
Forget that, I thought it better to check it for you and solve the problem.

 

..... CODE

 

This works to clear the error, but I can not actually test it as we have no Worldpay Account.

 

Can someone test it and feedback if it fixes the problem or not.

This way everyone can update their site to fix this if poss.

 

 

CC.

 

Tried this mod but it didn't change anything. :(

 

When I get the completed transaction back from Worldpay I still need to click the "continue" button to register it in "my orders".

 

SQL entered modification record in the Confiuration table OK

 

Please confirm I pasted you code in th eright place.

 

............... EXISTING CODE

// make sure no duplicate category IDs exist which could lock the server in a loop

$tmp_array = array();

$n = sizeof($cPath_array);

for ($i=0; $i<$n; $i++) {

if (!in_array($cPath_array[$i], $tmp_array)) {

$tmp_array[] = $cPath_array[$i];

}

}

 

return $tmp_array;

}

 

- YOUR CODE INSERTED HERE

 

 

////

// Return a random value

function tep_rand($min = null, $max = null) {

static $seeded; ...................... more original code

 

 

Any Ideas?

 

Kenny


If you learn more than you forget then that's a good thing.

Share this post


Link to post
Share on other sites

The only thing that code will succeed in doing is changing the order status for those on older snapshots where you were receiving an error.

 

It wont fix the fact that you have to click continue for it to update your order.

 

Maybe add a little javascript to that page, where they have to click continue 'To complete the order' before it will let them do anything else...

 

Just an idea...

 

CC.

Share this post


Link to post
Share on other sites

OOPS _ I made these changes to the wrong directory - catalog/include/functions/general.php instead of admin/include/functions/general.php

 

Removed from wrong file but the code you suggest is already in the admin version of general.php - to the letter.

 

Anyway, still no difference. CC, There's no reference to the new record in the Configure table in the code you offered.

 

I don't suppose you pasted some old code in error?

 

Any thoughts?

 

Kenny


If you learn more than you forget then that's a good thing.

Share this post


Link to post
Share on other sites

Nope.

That means you have the newer snapshot that this works on anyway.

 

That code was for post Nov, but before mid Jan I think it was.

 

So if you have one newer than mid Jan then it will already be in your code, thus no need to update.

 

Just tell me once again what error you are getting, copy and paste it here.

 

CC.

Share this post


Link to post
Share on other sites

OOPS _ I made these changes to the wrong directory - catalog/include/functions/general.php instead of admin/include/functions/general.php

 

Removed from wrong file but the code you suggest is already in the admin version of general.php - to the letter.

 

Anyway, still no difference. CC, There's no reference to the new record in the Configure table in the code you offered.

 

I don't suppose you pasted some old code in error?

 

Any thoughts?

 

Kenny


If you learn more than you forget then that's a good thing.

Share this post


Link to post
Share on other sites

hmmm

 

Did you reply this on purpose 3 hrs after the original post?

 

If you are asking again, see my previous post that answered this...

 

CC.

Share this post


Link to post
Share on other sites

I will try and have a look at the "not clicking continue" problem over the weekend.

 

CC - do you have any suggestions of java scripts to prevent users clicking links other than the continue button?

 

Graeme

Share this post


Link to post
Share on other sites

Finding a way to disable links is not really an option as there is no way that you can prevent the user from accidently closing the window. Which will prevent the updates to the admin systems firing.


I wish....

I had the Money of Bill [Gates]

The Wit of Oscar [Wilde]

and could play the guitar like Carlos [santana]!!!

 

 

I guess I'll just have to settle with being me! :D

Share this post


Link to post
Share on other sites

Hi People i am getting the same error:

 

Warning: call_user_func() expects first argument, 'tep_get_order_status_name', to be a valid callback in /home/carl/public_html/shop/admin/includes/functions/general.php on line 1232

 

does not add order to admin also

 

is there a fix for this yet

 

cheers carl

Share this post


Link to post
Share on other sites

Do the problems with WP never end???

 

This morning as I was solving another issue - I discovered that when using non-western character sets, the ',' separator in the number format gets converted to %2C. So 13,000 becomes 13%2C000 which then fails at WP - I then checked on other similar issues.

 

I discovered that whilst your version eliminates the ',' here:

 

$OrderAmt = number_format($order->info['total'] * 100 * $currencies->get_value($currency), 0, '','') ;

$OrderAmt = $OrderAmt /100 ;

 

instead, you create another potential problem which is that you force all order amounts to have 2 decimal places. Fine for those currencies that have them but doesnt work for those that do not. e.g. 13000.01 yen seems to fail at WP.

 

So I suggest (and it is untested on your snapshot) using:

 

$OrderAmt = number_format($order->info['total'] * 100 * $currencies->get_value($currency), $currencies->get_decimal_places($currency), '.', '') ;

 

 

instead. Here the decimal places will be correct for the currency used and the decimal dot (the default in western character sets) used. For currencues that do not have decimal places, the dot is not used anyway so no error.


Ian-san

Flawlessnet

Share this post


Link to post
Share on other sites

Ian,

 

I suspect this problem relates to other payment modules as well as Worldpay.

 

On another issue, my own site went live on Friday, and on my very first order the user did not click continue after the Worldpay callback, thereby highlighting the problem that the Worldpay orders are not processed despite payment being received.

 

Therefore this has become an urgent issue for me to resolve, and I will incorporate your suggestion into that version.

 

Regards

Graeme

Share this post


Link to post
Share on other sites

Scotty - Nice to see a live transaction testing this out.

 

Not nice to see it didnt work fully for you. :(

I just hope it can be resolved for any one using WorldPay.

 

Hell knows there's plenty of them these days.

 

Let me knowif I can help in anyway.

 

CC.

Share this post


Link to post
Share on other sites

Have just integrated the Module into my site. I would recommend that the following changes are made which allow the module to link back to the site even with an order processed with SSL on.

 

I would update the contribution however I am using a Dec snapshot and so don't want to mess up other parts of the mod.

 

1) Instead of passing WorldPay the store and customer name as the cartId you should pass the session id to WorldPay. This is done in the payment module by changing:

 

tep_draw_hidden_field('cartId', STORE_NAME.' : '.$order->customer['firstname'].' '.$order->customer['lastname']

 

to

 

tep_draw_hidden_field('cartId', $worldpay_url

 

note $worldpay_url was already set in the module and is the session name and session id ie $worldpay_url = tep_session_name() . '=' . tep_session_id() ;

 

2) On callback WorldPay passes cartId back to the site and hence you can use this in the tep_href call. I also added a warning message to make the user click on the continue button. The following code is the result:

{ // Success!

print "<tr><td class='pageHeading' width='100%' colspan='2'><center>Your payment was successfully received - Thank you!</center></td></tr><tr><td class='main'><center>Worldpay Response<br></center></td></tr>";

print "<tr><td><WPDISPLAY ITEM=banner><br></td></tr>";

echo "<tr align='center'><td><b>You must now click on continue to complete the order. Failing to do so will delay your delivery.</b><td></tr>";

echo "<tr align='right'><td><a href=" . tep_href_link(FILENAME_CHECKOUT_PROCESS, $cartId, 'SSL', false) . ">" .tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . "<td></tr></a>" ;

}

 

3) I have commented out the columns left and right in the callback file to limit the number of options available to the user which will make them more likely to click on the continue button.

 

Hope the above is of use.

Share this post


Link to post
Share on other sites
Ian,

 

I suspect this problem relates to other payment modules as well as Worldpay.  

 

very true I think

 

On another issue, my own site went live on Friday, and on my very first order the user did not click continue after the Worldpay callback, thereby highlighting the problem that the Worldpay orders are not processed despite payment being received.

 

Therefore this has become an urgent issue for me to resolve, and I will incorporate your suggestion into that version.

 

Personally, I would just comment out the continue button on success and then it should work fine - even if it is against the wp rulebook the wpbanner is not really essential as you show success once you get back to checkout success.


Ian-san

Flawlessnet

Share this post


Link to post
Share on other sites

Rather than comment out, you would need to replace it with an auto-redirect to checkout_process I think.


Ian-san

Flawlessnet

Share this post


Link to post
Share on other sites
Rather than comment out, you would need to replace it with an auto-redirect to checkout_process I think.

 

This is probably the best route as WP require you to display their message banner straight after they have processed the card. Something like the following placed in the header section should do it

 

if(isset($transStatus) && $transStatus == "Y")

{ // Success!

$url = tep_href_link(FILENAME_CHECKOUT_PROCESS, $cartId, 'NONSSL', false);

echo"<META Http-equiv='refresh' Content='30; Url=".$url."' > ";

}

{

 

$url = tep_href_link(FILENAME_DEFAULT, $cartId, 'NONSSL', false);

echo"<META Http-equiv='refresh' Content='30; Url=".$url."' > ";

}

 

 

This will show the banner for 30 seconds and move on.

Share this post


Link to post
Share on other sites

Im not sure users would wait for 30 seconds before redirecting.

 

I am working on making the checkout_success.php file the callback file, therefore saving one stage.

 

I will hopefully have something to test later today.

 

Graeme

Share this post


Link to post
Share on other sites

Nick - anyway a nice code snippet, you should add it to tips n tricks as it could be useful elsewhere.


Ian-san

Flawlessnet

Share this post


Link to post
Share on other sites

The 30 seconds is one of the variables you could set it to 10 if you want. However you have to let the user see the WP message.

 

However the idea of integrating the callback page into the sucess page sounds even better. :wink:

 

Another advantage of doing that would be allowing the system to record the transId number passed back by WP.

 

Let me know how you get on. At the moment I am recording the session ID .

Share this post


Link to post
Share on other sites

Hi

 

While trying to develop the next release which resolved the clicking on other links problem, I am trying to get a bit creative with the callback URL.

 

Here is what I have got so far

 

http://www.irishsportscorp.com/<WPDISPLAY ITEM=transId DEFAULT="checkout_payment.php" PRE="checkout_success.php?transid=" POST="">

 

This returns

http://www.irishsportscorp.com/checkout_payment.php

if the transaction is cancelled

 

and

http://www.irishsportscorp.com/checkout_success.php?transid=xxxxx

 

The code works to an extent (and is approved by Worldpay), however it loses the cookies / session and therefore does not complete (or cancel) the order successfully.

 

Can anyone help me in retriving the cookie/session details or let me know what variables I can pass.

 

Thanks for any help.

 

Graeme

Share this post


Link to post
Share on other sites

Ok more important that we get this working now, cos we have just had to get Worldpay too. :shock:

We didnt think we would be using it, but now we have decided too for the short term...

 

I will look and I hope any good developers can assist too, Worldpay is a big thing these days, so loads will benefit!

 

CC.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×