Forums / Developer / Worldpay gateway added

Worldpay gateway added

Author Message

Paul Forsyth

Monday 01 November 2004 10:11:17 am

Yes, thats possible.

We should add a 'window.onload=' to that code to make sure the page is loaded before it starts counting. The code also move to the bottom of the template but i'm not sure if that guarentees that it will execute later.

Thanks!

paul

Eirik Alfstad Johansen

Thursday 03 March 2005 4:10:13 am

Hi Paul,

Around line 105 in modules/worldpay/callback.php, I find the following code:

//Local ini file installationID
           if ( $ini->hasVariable( "Worldpay", "InstallID" ) )
            $local_install_id = $ini->variableArray( "Worldpay", "InstallID" );

           //Make sure they match
           if ( $wpinst_id == $local_install_id )
           return true;

Shouldn't the the ini object call the variable() method instead of variableArray(), or am I missing something here?

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Paul Forsyth

Thursday 03 March 2005 4:36:25 am

I think you are right. The installation id is a single value so there is no need to return an array.

Looking at our recent code this isnt in it so we may have to update.

Thanks for spotting this.

Paul

Eirik Alfstad Johansen

Thursday 03 March 2005 5:19:47 am

Hi Paul,

As you might have guessed, I'm working on implementing your worldpay extension again, since I never quite got it running the first time.

Now, I've run into some problems with the callback view, and more specifically, the isAmountOK() function. The problem is that this function expects to find the following variables in my xrate.ini file:

GBP_GBP
GBP_EUR
GBP_USD

whereas my file only contains a value for the variable NOK_NOK (since we are only accepting Norwegian kroner).

I suspect that something is hard coded here that shouldn't be, but since I'm having a hard time understanding the purpose of this function, I'm unable to correct it myself.

Could you please take a look? Thanks in advance !

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Paul Forsyth

Sunday 06 March 2005 9:24:12 am

I agree, it is a litte hardcoded. A better solution would be to perform an analysis based on your own currency exchange (NOK to NOK) and be a litte more dynamic. For now you could just add a couple more lines, another if statement and another line to the switch statement.

paul

Bernhard Reiter

Sunday 13 March 2005 7:36:52 am

Hello,
Are there any plans to also integrate FuturePay in the near future?

Tony Wood

Sunday 13 March 2005 12:32:34 pm

In short yes... but it will come after the upgrade to use the nice new shop features in 3.5.1. Sorry no timescale yet.

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Bernhard Reiter

Monday 14 March 2005 11:44:44 am

Since i need it, it looks like i gonna have to develop a solution on my own. At least until your extension is ready.

I have the read the docs from worldpay on SelectJunior and FuturePay.
I plan to create a new extension based on your work, but with the additions to the form needed to get FuturePay to work.
I dont know yet what else needs to be changed in your code, but i will start to read through it.
As i plan to use both extensions, but for different sections of the site, i thought i could implement that with an multiplexer workflow.

Any suggestions on things i should consider or on the general plan are appreciated!

Bernhard Reiter

Wednesday 16 March 2005 3:49:26 am

Hello,
me again ;-)

I have a question regarding the address matrix field, and the way it gets processed in worldpaytype.php.
It seems like i would need to make two rows, one for the street and one for the zip. But this way they would not have any labeling as i can only label cols.

It would be great if someone could clear up why the address processing si done this way.
Might sound like a stupid question, but i somehow dont get the grip.

Paul Forsyth

Wednesday 16 March 2005 3:57:03 am

The reason for the matrix datatype was because different clients needed different fields. To put these fields into a class would then have consequences for the extension which would rely on those attributes being present. Instead we chose the matrix datatype which allows more flexibility.

Admittedly it isnt always needed :) Plus the design choice is a few years old. I can see a few ways to improve it.

If you want to remove the matrix datatype just make sure you reference the correct attributes in the extension. Its only an address after all ;)

paul

Eirik Alfstad Johansen

Monday 08 August 2005 4:38:24 am

Hi Paul,

Have you ever used the WorldPay extension in conjunction with anonymous shopping successfully?

My problem is that when I return from the WorldPay terminal and click the link to view the order, I'm asked to log in.

Could the reason for this be that the session id is lost along the way?

Thanks in advance !

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Paul Forsyth

Monday 08 August 2005 5:38:13 am

Hi Eirek,

Does your anon user have permissions to view that module view? :)

We are actually in the middle of trying out anon registration with worldpay, using shop/userregister. I'll post if there are problems.

Paul

Eirik Alfstad Johansen

Monday 08 August 2005 6:06:25 am

Hi Paul,

The anonymous user is able to shop|buy by default (which I assume includes viewing its own order).

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Bo Vejgaard

Monday 08 August 2005 6:45:23 am

Hi Eirik,

You need to give the Anon user access to shop|orderview as well.

-Bo

Eirik Alfstad Johansen

Tuesday 09 August 2005 3:01:00 am

Hi Bo,

orderview is not amongst the avilable options (v. 3.5.2). Under the shop module, I can only select between setup, adminstrate and buy.

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Paul Forsyth

Tuesday 09 August 2005 3:14:49 am

Yes, you are right. It isnt an option in 3.5. Orderview is linked to the 'buy' permission.

The orderview code does perform an explicit check on the session (kernel/shop/orderview.php):

        if( $OrderID != $http->sessionVariable( 'UserOrderID' ) )
        {
            $access = false;
        }

One thing you could try is to disable sessions per siteaccess. This 'may' keep the same session when worldpay returns:

[Session]
SessionNamePerSiteAccess=disabled

Although it might not.

You could patch orderview.php with a different check for access.

paul

Eirik Alfstad Johansen

Monday 15 August 2005 12:58:21 am

Hi Paul,

Thanks for the suggestion. Disabling sessions pr siteaccess didn't help. I also tried adding the following near the end of worldpay/callback

	// set order id in session variable for use in shop/orderview
		$http =& eZHTTPTool::instance();
		$http->setSessionVariable("UserOrderID", $order_id );

...but this didn't do anything either. I can't understand why not, though.

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Paul Forsyth

Friday 13 January 2006 3:03:55 am

FYI, we've refreshed the worldpay extension for 3.5 and above. The contrib area and pubsvn have been updated.

Paul