Jump to content
Sign in to follow this  
scottymcloo

Worldpay support III

Recommended Posts

The have moved the currency download to https:// from http:// and not bothered to tell anyone.

 

You will need to mod you scripts accordingly (something which I have not got round to yet)


Patrick Weightman

Share this post


Link to post
Share on other sites

Thanks for your reply Patrick.

 

From what i can see we'll have to use cURL extension with an HTTPS URL. Plus it looks like the cURL extension will need access to an SSL library like OpenSSL.

 

I'm going to have a look at doing it

 

cheers

 

Eliot

Share this post


Link to post
Share on other sites
The have moved the currency download to https:// from http:// and not bothered to tell anyone.

 

You will need to mod you scripts accordingly (something which I have not got round to yet)

Correct - but I don't think you can make the change as https should not allow automatic access in the way the currency update script currently works.

 

The answer (for me at least) was to ask WP to add all my display currencies to my installation (which they did free of charge) and so the WP currency conversion is no longer required (as the displayed currency price is now used in WP without conversion).


Ian-san

Flawlessnet

Share this post


Link to post
Share on other sites

My way round this was to write a Visual Basic program that gets the currencies from worlpay then updates the database, I have been on about doing this for a while as it allows me to schedule the update from my PC.

 

If anyone wants the Source / Binaries for this then I will add a contribution, or mail me and I will zip it up and send it to you.


Patrick Weightman

Share this post


Link to post
Share on other sites

Hi guys

 

i did it in curl by changing the Download function in admin\includes\classes\currency_update.php to

 

  function Download(){
 

   $fh = fopen('exchangerates.txt','w') or die($php_errormsg);
   $c = curl_init($this->url);
          curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt($c, CURLOPT_FILE, $fh);
          curl_exec($c);
	 
   curl_close($c);
	 
     if (!$fh) {
       echo $errno;
       echo $errstr;
    exit;
     } 
	 
   fclose($fh);
	 
   $fh = fopen('exchangerates.txt','r');
     
     while (!feof($fh)) {
      	 $result = fgets($fh, 128); 
  	 
   if( ereg( "rateDateString=", $result ) ){
  	 $this->date = eregi_replace ( "rateDateString=", '', $result  );
   }
   
   //	GBP_EUR=1.5613517146775129
   if( ereg( '(' . $this->sourceISOCode . ')_([A-Z]){3,3}=[0-9].([0-9]){1,2}', $result ) ){
   
  	 list ( $sourceISOCode, $destinationISOCode, $rate ) = split ('[_=]', $result );
  	 //echo "sourceISOCode: $sourceISOCode; destinationISOCode: $destinationISOCode; rate: $rate<br>\n";

  	 $n = array( 'destinationISOCode'=>trim( $destinationISOCode ), 'rate'=>trim( $rate ) );
  	 array_push( $this->exchangeRates, $n );
   }
     } 
	 fclose ( $fh );
 }

 

then i changed the $worldpayUrl in admin\currencies.php to

 

	
$worldpayUrl = 'https://select.worldpay.com/wcc/info?op=rates&instId=' . $instId . '&infoPW=' . $infoPW;

 

then i created a file called exchangerates.txt in the admin directory.

 

You also need to be using the curl extension, and it needs access to an SSL library (i use OpenSSL)

 

hth

Share this post


Link to post
Share on other sites

Hi Guys,

 

I am running OS Commerce on my own PC (localhost) and it works great. I installed the Worldpay Module and got a test WP account.

 

The problem is that the callback function is not getting called. I receive an email which says

 

Error reported: Callback to

http://localhost/catalog/wpcallback.php?language=en: NOT OK, received

HTTP status: 404

(According to WP this error is caused by a page that does not exist)

 

Just to test I copied the url into my browser and the page got executes so the page DOES exist.

 

Is it because WP cannot resolve "localhost" perhaps? I tried changing localhost in my config files to the ip address of my pc (win 98 pc) and then I got:-

 

Error reported: Callback to:

http://xxx.xxx.xxx.xxx/catalog/wpcallback.php?language=en: failed CAUSED

BY Timed socket connection failure - took more than 30000ms

 

 

Any ideas or suggestions? :unsure:

 

thanks,

Alan

Share this post


Link to post
Share on other sites

As you say, localhost is the problem. Your page does not exist on the WP server (which is what using localhost implies) so you need to make sure that the callback is to a real, full, URL.

 

WP probably do not allow callbacks to IP addresses either for security reasons (but not sure about this).


Ian-san

Flawlessnet

Share this post


Link to post
Share on other sites

thanks Ian,

 

I guess I'll have to wait till I host my site on a real webserver before I can test this callback.... ;)

 

Alan B.

Share this post


Link to post
Share on other sites

I have now done a bit more work on the Visual Basic Currency Update program, so that it can be run using command line parameters for DNS, InstID and Password etc.

 

I am now running it as a scheduled task on my Win2K server so that it checks and updated the currencies automatically at regular intervals

 

I cannot post it as a contribution as it is over the 300kb limit , so if anyone wants a copy let me know and I will stick it up on the net somewhere for download


Patrick Weightman

Share this post


Link to post
Share on other sites

Hi guys. It appears that I'm not the only one still suffering from the customer not clicking on continue saga. We lose about 5 orders a week like this and there has to be a solution.

 

We have the latest version of the payment module installed but still people close the window before the re-direct kicks in. For some reason there is also a warning box popping up about leaving a secure connection, then once you click "OK" you get another one saying you are being passed to a secure page?

 

On another quick point. Is it possible to include the WP transaction ID somewhere to make doing refunds easier? When we receive goods back we have to find the e-mail from WP from the original purchase in order to find the transaction ID and do the refund. Much better if that info was on the invoice that we printed out, then we would have it to hand immediately.

Share this post


Link to post
Share on other sites

Yup, we still have an issue with people not waiting for the redirect. The order needs to be entered into the system from wpcallback.php not the final Order Complete page. That shouldn't be too hard to do but I don't have time myself!

 

As for the security warnings, that could be since Worldpay being secure is calling in a page from your site which isn't secure (wpcallback.php) and then going back to Worldpay and then redirecting to your final page. So if warning are on you'll go in/out of secure mode, which again is less than ideal.

 

The only real answer is to integrate OSC with something other than Select Junior and use a more sophisticated integration method. But again, I really can't afford time to do that myself :(

Share this post


Link to post
Share on other sites

There are probably enough people interested to pay to get this done. We should probably post this as a job on the 'seeking commercial help' forum if that is still around.

Share this post


Link to post
Share on other sites

There's no forum for 'Commerical help' any more AFAIK.

 

I could look into it next week, but anyone interested would have to move to Private Messages to have that conversation due to the board rules.

 

I know everything I need to do it, but I can't justify the time for the project at the moment.

 

I was hoping someone else would have the skills & time, but if not it may be worth asking me :)

Share this post


Link to post
Share on other sites

Hey, I eventually decided to dump STS templates for the moment just to get worldpay to work... damn thing

 

Anyways, before I used to almost get a 'callback' that screwed with the templates....

 

now I just get a huge error message... any guidance here ? :-|

Warning: main(includes/languages/english/wpcallback.php): failed to open stream: No such file or directory in /home/gymwearx/public_html/store/wpcallback.php on line 29

 

Warning: main(includes/languages/english/wpcallback.php): failed to open stream: No such file or directory in /home/gymwearx/public_html/store/wpcallback.php on line 29

 

Fatal error: main(): Failed opening required 'includes/languages/english/wpcallback.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/gymwearx/public_html/store/wpcallback.php on line 29

1062 - Duplicate entry 'c86941c62884256c25fa80e86e4cbc4d' for key 1

 

insert into sessions values ('c86941c62884256c25fa80e86e4cbc4d?language=en', '1072633169', 'SESSION_USER_AGENT|s:45:\"WJHRO/1.0

------ it then goes on to more code and more personal info about me------

 

and then at the bottom goes like this...

[TEP STOP]

 

 

Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0

 

All files are present and correct to my knowledge... athlough one thing I'm not sure about is the current lack of domain? The domain I'm meant to be using is already on a production shop so I cant just redirect and see what happens... I'm using the main domain with the account name as the site addy...

 

any help here would be great... I'm just about pulling what hair I have left out here...

 

cheers,

Ian.

Edited by Nossie

Ian Harvie

Share this post


Link to post
Share on other sites

On the face of it, I would say it is a file system permission problem - is your php setup for safe mode and so maybe cannot open the application_top file?


Ian-san

Flawlessnet

Share this post


Link to post
Share on other sites

it could very well be other files with the wrong permissions.....

 

I never checked them all when I reinstalled OSc

 

I'll check it out tomorrow...

 

cheers

 

:blink: :rolleyes:


Ian Harvie

Share this post


Link to post
Share on other sites

Hi,

Im going around circles with the worldpay module. Maybee one of you kind souls could help me??

 

I have everything installed and working o.k but im having two errors...

 

1) The first one is after a payment has been made it appears as if something is trying to put a double entry in to the sessions table. Although everything seems to be fine both at my end and the world pay end. It is outputing a duplicate error which looks a mess and Im sure it shouldn't be happening??

 

2) When I try to update my currencies using the new button in admin. It takes ages then I get the following error

 

 

Warning: fsockopen(): unable to connect to select.worldpay.com:80 in /home/freeride/public_html/admin/includes/classes/currency_update.php on line 48
110Connection timed out

 

After this the currencies seem to update but again I'm sure this shouldn't be happening.

 

If anyone has any ideas on how I might be able to solve either of these issues Please let me know as im going mad!!

 

THanKs iN adVaNCe

 

Nimmit


Knowledge is knowing that a tomato is a fruit, wisdom is not putting one in a fruit salad :D

Share this post


Link to post
Share on other sites

On the second point, WP recently changed its currency server from http to https - so if you are using the unmodified WP currency update contribution it will not work - the delay is probably due to waiting for it to time out. Someone posted some changes to this mod recently - not sure where.


Ian-san

Flawlessnet

Share this post


Link to post
Share on other sites

Can someone give me a link to the latest worldpay contribution

 

Thanks in advance


No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P


Support The Project
Documentation/Knowledgebase/Discussions
 

Share this post


Link to post
Share on other sites
The confusingly titled Worldpay 4 MS1 is the latest version for MS2

Thanks RADDERS

 

Your answer was spot on

 

That was what was confusing me the search revealed the contribution for 2.2 but then the contribution itself was saying MS1


No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P


Support The Project
Documentation/Knowledgebase/Discussions
 

Share this post


Link to post
Share on other sites
On the face of it, I would say it is a file system permission problem - is your php setup for safe mode and so maybe cannot open the application_top file?

Hi..

 

I just realised that there were no files to chmodd with osc?

 

last time I installed osc via fantastico ....

 

I then went back here and your talking about safemode...

 

not the file permissions lol...

 

no my server doesnt run in safemode :)

 

any other thoughts? :blink:


Ian Harvie

Share this post


Link to post
Share on other sites

Hi Ian I'm getting a similar problem to you.

It apears as if its trying to insert another session of the same name into the sessions table when it returns back to my server from worldpay.

 

1062 - Duplicate entry 'e87cb00d1c18c8ac90d0f2cb81ad15fa' for key 1

insert into sessions values ('e87cb00d1c18c8ac90d0f2cb81ad15fa?language=en', '1073074226', 'cart|O:12:\"shoppingcart\":4:{s:8:\"contents\";a:0:{}s:5:\"total\";i:0;s:6:\"weight\";i:0;s:12 - etc etc

 

I cant figure it out for the life of me! if anyone has any ideas please let me know I have spent soooo much time trying to sort this one out!!

 

Sam


Knowledge is knowing that a tomato is a fruit, wisdom is not putting one in a fruit salad :D

Share this post


Link to post
Share on other sites

Hello All,

 

Have upgraded my site to 2.2ms2 and have tried to install the latest WorldPay Payment module Worldpay 4.0 - V1.0 (with download Worldpay_MS1_version_a.zip).

 

When I copy the files into their correct places I lose the Install Remove & Edit options on the right hand side of the payment module screen.

 

If I remove the WorldPay files all is ok.

 

Does anyone have any ideas on what would cause this?

 

Cheers,

Simon.


Cheers,

Simon

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  

×