Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Worldpay Support


Recommended Posts

The problem with storeman lies in his worlpay.php code.....

 

Warning: Unknown(): The session id contains illegal characters, valid characters are only a-z, A-Z and 0-9 in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

 

A trick for all who are experiencing problems with any modules such as this, is to grab the actual code that has been generated after the server has processed it. The code itself will usually give you the answer.

In this case, the MC_callback field had been assembled with the language parameter on the end, utilising a ? instead of a & Hence the illegal character - it looks OK at first glance, but try and emulate what the parser will do and BINGO :)

 

Why is everybody using that language parameter anyhow :?:

 

I still see a lot of people are using redirects in the final page after WorldPay is complete - this is still a contravention of their Ts & Cs - NO automatic redirects at all.

 

If there is a problem with lost orders due to user cock ups, why not code code it in to wpcallback.php or the after process function in worldpay.php ?

All pages act just like a normal session would do, except that for a short period WorldPay becomes the client, not your original customer.

Yes the globals are lost, temporarily, but pass the session ID in the callback URL (I placed the code here a while ago) and any other important info into MC_ prefixed variables and you can recover all the info you need within wpcallback.php and update the database and retain the order.

In real terms this means incorporating checkout_success.php etc into wpcallback.php, but that's the only way to get a reliable system written.

OK, I haven't done it with my implementation of OSC, but I have with other store systems and eliminated the errors. It all comes back to effort and reward.

IF I get some time (which I doubt before autumn) I will attempt to come up with a complete package that addresses these issues, but if somebody else wants to in the interim....... :shock:

 

Enjoy :arrow:

Link to comment
Share on other sites

  • Replies 180
  • Created
  • Last Reply

Top Posters In This Topic

I still see a lot of people are using redirects in the final page after WorldPay is complete - this is still a contravention of their Ts & Cs - NO automatic redirects at all.

 

That may be true but if you ask WP, they still recommend that you use version 3c of this mod which works entirely on auto-redirects. They explained it to me that they have the condition to a) prevent redirects to sites OTHER than the origin and B) to allow the user to read their banner. The MS1 version of the WP mod meets both those conditions.

Ian-san

Flawlessnet

Link to comment
Share on other sites

In this case, the MC_callback field had been assembled with the language parameter on the end, utilising a ? instead of a & Hence the illegal character - it looks OK at first glance, but try and emulate what the parser will do and BINGO :)

 

That is only part of the problem. That part of the code as-is works OK if the user has cookies enabled. The problem comes when cookies are disabled and OSC is having to propagate osCsid. With cookies enabled the MC_callback value looks something like:

value="www.example.com/catalog/wpcallback.php?language=en">

 

With cookies disabled it looks something like this:

value="www.example.com/catalog/wpcallback.php?osCsid=10bfe8d3dfae5a892a8f827ea9f4f190?language=en">

 

The fix for it would be to check the callback link for the presence of osCsid and act accordingly. Here's the relevant patched section from my copy of /catalog/includes/modules/payment/worldpay.php:

// Ian-san: Create callback and language links here 6/4/2003:

     $callback_url = tep_href_link(FILENAME_WPCALLBACK);

     $worldpay_callback = explode('http://', $callback_url);

     $language_code_raw = tep_db_query("select code from " . TABLE_LANGUAGES . " where languages_id ='$languages_id'");

     $language_code_array = tep_db_fetch_array($language_code_raw);

     $language_code = $language_code_array['code'];



     $address = htmlspecialchars($order->customer['street_address'] . "n" . $order->customer['suburb'] . "n" . $order->customer['city'] . "n" . $order->customer['state'], ENT_QUOTES);

     $process_button_string .=

       tep_draw_hidden_field('testMode', MODULE_PAYMENT_WORLDPAY_MODE) .

       tep_draw_hidden_field('name', $order->customer['firstname'] . ' ' . $order->customer['lastname']) .

       tep_draw_hidden_field('address', $address) .

       tep_draw_hidden_field('postcode', $order->customer['postcode']) .

       tep_draw_hidden_field('country', $order->customer['country']['iso_code_2']) .

       tep_draw_hidden_field('tel', $order->customer['telephone']) .

       tep_draw_hidden_field('myvar', 'Y') .

       tep_draw_hidden_field('fax', $order->customer['fax']) .

       tep_draw_hidden_field('email', $order->customer['email_address']);



// Ian-san: Added dynamic callback and languages link here 6/4/2003:

       $process_button_string .= tep_draw_hidden_field('lang', $language_code);

       // the callback link is invalid when cookies are disabled and relying on trans_sid

       // so check whether sid is in the url and change link accordingly

       if (strstr($worldpay_callback[1], 'osCsid') !== false) {

         $process_button_string .= tep_draw_hidden_field('MC_callback', $worldpay_callback[1] . '&language=' . $language_code); }

       else {

         $process_button_string .= tep_draw_hidden_field('MC_callback', $worldpay_callback[1] . '?language=' . $language_code);

       }

       $process_button_string .= tep_draw_hidden_field('MC_oscsid', $oscSid);

 

hth

Jason Wong

Link to comment
Share on other sites

There have been a lot of suggestions for code changes to make the WP module more reliable/robust, etc.

 

I started to incorporate these into a new version - however, MS2 is due for release on Tuesday next week, so it makes sense to wait until then and release a module that works (and can be tested) on MS2 as well as MS1.

 

So, I will work on the new module from tuesday, incorporating as much as I can remember into it.

 

So, here's where I need help - If you have already suggested some change, please PM me with the details (save me going through the 29 odd pages of text since the release of MS1)

 

Thanks

Graeme

Link to comment
Share on other sites

I've added two recent fixes into my worldpay module (the one with the sleep 5 and the one which fixes the ? when the customer presses continue).

So far no problems with missing orders since then but the weather has been so lovely that very few people are sitting down at their computers to buy on-line.

What I found though when I put a test order through and hit continue, was a duplicate order one second after the original. I wonder has anyone else has found this :?:

This has happened 3 times over the last week so is unlikely to be cause by the ? fix that I unly implemented yesterday which leaves the sleep as the only recent change I had made. Of course it could be something else entirely :?

Link to comment
Share on other sites

Hi Guys

 

since i had the problem i displayed in the forum , i wanted to let you know the fixes that richie suggested did work for me i treid it several times and it did work fine .

i would like also to suggest to contact him if you have any question.

i would like to thank every one who did work in taht module it is wounderful efforts from all of you

 

I.O

Link to comment
Share on other sites

  • 2 weeks later...

hi , im afraid im on the bottom rung of the knowledge ladder on this so simple question is(ive put into the forum but got directed here)

Where do i upload the worldpay module to ?(which section or folders)

 

Also which basic changes do i have to make to it to correctly configure to my site....there are so many different posts and ideas here i cant keep up?

 

 

(if codes are to be added can i be advised where exactly as iam no expert)

 

i am greatful for any advice

jk

Link to comment
Share on other sites

hi , im afraid im on the bottom rung of the knowledge ladder on this so simple question is(ive put into the forum but got directed here)

Where do i upload the worldpay module to ?(which section or folders)

 

When you download and unzip the files will be in the proper folder names they should be put into on your site, so a file will go in languages/English will be in that folder of the same name on your site. just copy the file only from the unzipped folder name to the same named directory on your server.

What goes up MUST come down

Link to comment
Share on other sites

excellent thanks...how about changes to make are there any that i should definately change? im not oversure about the callback situation everyones referring to as havent used worldpay yet can anyone explain?

jk

Link to comment
Share on other sites

Hi,

 

I'm having a problem installing the Worldpay module into osC 2.2MS1. "Indigo" posted a topic earlier, and he seems to be having the same difficulties:

 

Hi,

 

We're trying to config the latest version of Worldpay MS1 - Version 'a' (Ian-san update), and having a few problems which I hope you can help me with.  

 

I've followed the instructions to the letter although the version of MS1 that we have does not have the catalog/includes/filenames.php. I have therfore added this to catalog/includes/application_top.php file instead as suggested in another thread.  

 

The module seems to install correctly but when I try to activate it I get the following error:  

 

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

 

If I then try to edit the details within the module, I get a further error:  

Fatal error: Call to undefined function: tep_cfg_pull_down_order_statuses() in /home/leaderfloouk/public_html/catalog/admin/modules.php(204) : eval()'d code on line 1  

 

Is this something to do with the missing filenames.php file  

 

Any pointers in the right direction would be appreciated!  

 

Thanks in advance

 

I'm sure there's a simple fix, but so far it has eluded me! :(

Link to comment
Share on other sites

Hi all!

 

I'm trying to implemend the latest worldpay module (MS1 - 04/08/2003) in our soon-to-use webshop (release date should be 07/05/2003). As I read in this thread I'm having the same problem as many other users: Worldpay callback doesn't work, so orders were not registered by Oscommerce. Everything else works, all the test modes are ok!

 

I've read this whole thread and tryed most of the suggestions that were made, but without succes!

 

I hope there's someone willing to help me out with this! The worldpay module is currently installed as mentioned in the readme without any modifications.

 

Webshop URL: http://huizenfactory.nl

OSCommerce version: 2.2 MS1

Worldpay Module: MS1 (04/08/2003 - Worldpay MS1)

Module is currently in TEST MODE 100 (accept all)

 

Big thanks!

Link to comment
Share on other sites

Hi Dominic

 

I've had a look, but I think your problem is more fundamental than the Worldpay module.

 

I'm getting

Parse error: parse error, unexpected '}' in /www/htdocs/huizen/catalog/product_info.php on line 181

 

Check your product_info.php file first, then I'll have a look at the WP problem.

 

Graeme

Link to comment
Share on other sites

Hi all!  

 

I'm trying to implemend the latest worldpay module (MS1 - 04/08/2003) in our soon-to-use webshop (release date should be 07/05/2003). As I read in this thread I'm having the same problem as many other users: Worldpay callback doesn't work, so orders were not registered by Oscommerce. Everything else works, all the test modes are ok!  

 

I've read this whole thread and tryed most of the suggestions that were made, but without succes!  

 

I hope there's someone willing to help me out with this! The worldpay module is currently installed as mentioned in the readme without any modifications.  

 

Problem is solved: Forgot the "define.... etc." in application_top.php :roll:

 

tnks scottymcloo for your fast support!

Link to comment
Share on other sites

i have just added the latest worldpay module in the appropriate folders etc....i cant make further changes yet as i am waiting for my details from worldpay.....but should the module now be showing in my admin? cos it isnt?

jk

Link to comment
Share on other sites

does anyone have an answer to this one please... as need to install worldpay

 

Providing you have put the right files in catalog/includes/modules/payment and catalog/includes/languages/english/modules/payment and are using MS1 or before, you should see 'Secure Credit Card Payment' in Admin.

 

If you do not, then it might be because you have changed something such as the class name - so check that everything important says 'worldpay' in lower case. e.g.

 

class worldpay

 

$this->code = 'worldpay';

 

etc.

Ian-san

Flawlessnet

Link to comment
Share on other sites

hi thanks , i had misplaced the one file....no idea how too long on computer perhaps ...appreciate your help it is now showing.

 

Can i ask you when i get my worldpay details through tomorrow hopefully ready to install....are there any particular changes i should definatly make to my files before doing so to make sure the call backs etc work properly?

 

Its just as a first timer i wont know what im looking for straight away.

 

cheers if you can help p.s im on cvs 2.2

jk

Link to comment
Share on other sites

Just make sure that you enter your Worldpay Installation ID in Admin, enable the module plus enter the callback info in WP Configuration manager - http://<wpdisplay item="MC_callback"> - see installation instructions in MS1 version - and you should have no problem. (If not using the MS1 version of the WP mod dont do this).

 

Good luck :)

Ian-san

Flawlessnet

Link to comment
Share on other sites

I use old version of Oscommerce and MS1 version of worldpay module. but I update some file to new version. I have set Callback Enabled and Use callback response has been checked. Callback URL set to http://<wpdisplay item="MC_callback"> . if I press CANCEL PURCHASE it can go back to shopping site, but if I press MAKE PAYMENT it can not go back to shopping site, and I can see what I just ordered in shopping site in admin page.

 

here is the params send to worldpay, would anyone help me to see where is wrong?

 

<form name="checkout_confirmation" action="https://select.worldpay.com/wcc/purchase" method="post">

<input type="hidden" name="instId" value="66666">

<input type="hidden" name="currency" value="USD">

<input type="hidden" name="desc" value="Purchase from Shirt Tailor of wwchan.com">

<input type="hidden" name="cartId" value="osCsid=0aae87d214b4766d12302a94572d458f">

<input type="hidden" name="amount" value="79.00"><input type="hidden" name="testMode" value="100">

<input type="hidden" name="name" value="john zhao"><input type="hidden" name="address" value="hongkong

new t

hongkong

California">

<input type="hidden" name="postcode" value="23265">

<input type="hidden" name="country" value="">

<input type="hidden" name="tel" value="111111">

<input type="hidden" name="myvar" value="Y">

<input type="hidden" name="fax" value="">

<input type="hidden" name="email" value="[email protected]">

<input type="hidden" name="lang" value="en">

<input type="hidden" name="MC_callback" value="wwchan.com/catalog/wpcallback.php?language=en">

<input type="hidden" name="MC_oscsid" value="">

<input type="image" src="includes/languages/english/images/buttons/button_confirm_order.gif" border="0" alt="Confirm Order" title=" Confirm Order ">

</form>

 

thank you !

John

Link to comment
Share on other sites

if I press MAKE PAYMENT it can not go back to shopping site, and I can see what I just ordered in shopping site in admin page.

 

Where does it go? Do you see the WP banner or do you see the wpcallback file included in the contribution?

Ian-san

Flawlessnet

Link to comment
Share on other sites

Hi all,

 

I'm new to osCommerce, but I was asked to assist on a site which wanted to integrate WP Mod MS1.

 

I'd like to say a big thankyou to Graeme and all those who assisted him with the creation of MS1. :D

 

Having read the whole thread a couple of the extra enhancements added may be of some use.

 

We have added a new table and code to capture the returned Worldpay values matched against the order.

These transaction details can be viewed from the Admin Module using a

written Admin module.

 

If these enhancements are of use let me know.

Cheers

G.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...