Protx payment gateway - has it been done?

Posts: 13
Joined: 12/10/2007

Hello.

I am fairly new to Ubercart but love what I see so far. I am in the UK and interested in using Protx VSP Direct as the payment gateway for cards.

Has anyone set up Ubercart with this (or any) Protx payment method? Is it relatively painless?

Either way I would be keen to get it working and add it to the payment contributions.

Any advice would be warmly received.

Many thanks.

Posts: 5367
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Welcome aboard, mccool. I haven't heard of this one, unfortunately... hopefully you can use one of the existing CC modules as a starting point for the integration.

Posts: 13
Joined: 12/10/2007

Hi Ryan.

Thanks for your reply.
Which existing CC module would you suggest as a starting point?
And is there specific documentation on creating a new payment gateway?

Cheers.

McCool

Posts: 5367
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

For documentation, you might check out hook_payment_gateway(). If Protx is just a service that you can submit data to remotely for processing a credit card, then maybe start w/ something like uc_authorizenet.module. If it's a hosted solution where you actually have to be redirected from Ubercart to complete payment, you'll need to mimic something like 2Checkout or PayPal Website Payments Standard. Then you'd need to check out the payment method docs.

Posts: 2
Joined: 12/16/2007

Hi McCool,

How are you getting on with this, I also need to integrate with ProtX...

Need a hand?

Posts: 13
Joined: 12/10/2007

Hi browman.

I'm just getting started - but I don't have the Protx account details from the client yet and I'm not sure how far I can get without them. I will hopefully have the required details by the end of the week.

Meanwhile I am investigating the Protx documentation and other Ubercart payment modules to get an idea of what I need to do.

My client is going for the VSP Direct package and wants it live for early January.

What's your plan and time scale? I'd be happy to collaborate!

Posts: 13
Joined: 12/10/2007

I have finally received the Protx account information, and am proceeding to write a payment module for Protx VSP Direct.
I'll let you know how I get on.

Posts: 13
Joined: 12/10/2007

Ok - displaying my full noob colours here!

I'm trying to create the Protx payment module, based on the uc_authorizenet.module, and I am fairly sure I know what I need to do.
I have my new Protx module installed, and in use, but at the 'Review Order' page, submitting the order just returns me to the same page.
If I manually force a success in the module, it processes the order.
So I need to debug my function uc_protxvspdirect_charge($order_id, $amount, $data).
I have installed the devel.module but I can't seem to get the function to display any of it's variables on the page. I need to view what the response is from the POST request.
So how can I display variables and arrays on the page.
I have tried using dsm() dvr() dpr() but to no avail.
Am I missing something obvious or do I just not understand how to use the devel module?

Any help or pointers greatly appreciated.

Cheers!

Posts: 5367
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Hmm... I think those should work, but I haven't used them myself. When I need to display debug info, I usually do this:

<?php
  drupal_set_message
('<pre>'. print_r($variable, TRUE) .'</pre>');
?>

You can also put debug benchmarks in the code, like dsm(1);, dsm(2);, etc. at various points in the module to see what parts get executed and where it goes awry.

Posts: 13
Joined: 12/10/2007

Hi Ryan.
Thanks ever so much for your swift reply.
I have the debug info displaying now - the problem was that I didn't have the $messages block set to display in my theme.
Doh!
A simple mistake which meant I was missing loads of information after every request.
Thanks again!
I'll crack on.

Posts: 2
Joined: 01/18/2008

I am also interested in a Protx module for ubercart, it looks so cool.

Any chance you got this working and are going to release your code?

would save a buuunch of time my end Smiling

Cheers in advance

Posts: 13
Joined: 12/10/2007

Hey robserious.
After much messing around I do have it working now - I will tidy up the code, read up on submittig contributions, and post it up.
It is for the Protx VSP Direct service, not VSP Form or VSP Server - just to be clear.
Cheers.

Posts: 2
Joined: 01/18/2008

Hey mrcool,

Thats cool, thats what i gotta setup.

Cheers again

Posts: 4
Joined: 01/24/2008

Hi Guys,

I've just uploaded an UC module which does the job of connecting to the Protx VPS Forms service.

It's here: http://www.ubercart.org/contrib/2773

Seems to work pretty well, but I would advise testing before production use. Please report any bugs and fixes on the comments thread..

( formerly 'browman' )

Posts: 3
Joined: 05/16/2008

Please post this module!!! I cant see that you have done so yet.Smiling

Posts: 56
Joined: 04/20/2008
Bug FinderGetting busy with the Ubercode.

I'm hoping to have one finished this weekend, and will post it here when I'm done. It'd be useful to have some guinea pigs. Sticking out tongue

Posts: 3
Joined: 05/16/2008

anybody done this yet? Seems to have gone cold here

Posts: 56
Joined: 04/20/2008
Bug FinderGetting busy with the Ubercode.

I have a working version, but unfortunately there are a couple of issues for core that need addressing before I can release it:
1) Reliable page referers. This is addressed somewhere in this thread.
2) Card Start Date & issue number. This is being discussed here.

The first seems halfway to being settled, and for the second it's been suggested that this could be an "enhancement module", but I think it's basic functionality that's required for Amex and Maestro, so it makes sense to standardise it and not make unnecessary dependencies for payment gateways.

Posts: 12
Joined: 06/23/2008

Hi there,

I am just about to tie into the Proxt VSP direct system with Ubercart and I thought it would be a good idea to check if anyone on this thread got to finish their Direct integration.

If not are there any pointers or "nearly there" code I could take a peak at?

I have adjusted authorize.net modules in the past to tie in with WorldPay direct system etc so I know what I need to do, just checking if anyone else has already done it Smiling

Thanks
Vince

Posts: 56
Joined: 04/20/2008
Bug FinderGetting busy with the Ubercode.

A quick follow-up...

The issues I mention above are, I'm hoping, close to being committed into core. I'm hoping, therefore, to be able to release this module over the coming week or two; but there's still a niggling issue with the Protx Test Server integration that I have to fix.

Posts: 56
Joined: 04/20/2008
Bug FinderGetting busy with the Ubercode.

Well, here it finally is -- the first tentative release. It implements 3D-Secure and the other features of the v2.22 specs. Please report any problems. There is a chance that the width & height of the 3D-Secure iframe may need to be tweaked.

You'll need to upgrade to Ubercart 1.2 to use it: this is because 1.2 has support for credit card Start Date and Issue Number, as well as allowing longer card numbers.

AttachmentSize
uc_protx_vsp_direct.zip40.31 KB
Posts: 27
Joined: 07/30/2008

@solarian: Nice I just got here, I am also into the task of developing this, actually I have already started lying out the main functions and i will certainly look at yours.. would you accept collaboration on this module, either in form of commits or patches? Anyway, will look at your module and let you know my thoughts.

a.=

Posts: 56
Joined: 04/20/2008
Bug FinderGetting busy with the Ubercode.

I would certainly welcome contributions, but my module fully implements v2.22 of the Protx specs and I don't think it requires any improvement -- I believe it's fully working. Am just waiting to get a Drupal CVS account, but they seem to be very slow. Perhaps you could put a word in, Ryan? At first they wrote back saying they couldn't authorise it because they couldn't see the code, even though I linked to this post -- very odd.

Posts: 27
Joined: 07/30/2008

I will soon start testing it and getting back to you if necessary, so far I can think of two improvements:

1. Support for AUTHENTICATE and DEFERRRED transaction types.
2. Store information that got back from the protx server in some internal table so more information can be available to the site owner and linked to the actual order.

Looking forward to your CVS account on drupal.org. In my case, I never got an answer from drupal.org but I found a CVS access tab on my user's profile and I was able to set me up a password there and then I was able to access it.

a.=

Posts: 27
Joined: 07/30/2008

I think I found one bug. I was testing the 3Dsecure redirection and I found that it was redirecting back to a different URL (w/o www.)

I was browsing http://www.example.com/ and the redirect from 3dsecure got back to http://example.com/ (thus $_SESSION being not properly set for that domain).

I believe the way the URL that is sent to the Secure3D page can be built more drupal-like to avoid this problem.

So I changed line 444 from:

<?php
  $TermUrl
= ($_SERVER['HTTPS']!='off' && $_SERVER['HTTPS']!='') ? 'https://' : 'http://';
 
$TermUrl .= $_SERVER['SERVER_NAME'] . base_path() . 'uc_protx_vsp_direct_3DSecure_callback';
?>

to

<?php
  $TermUrl
= url('uc_protx_vsp_direct_3DSecure_callback', null, null, true);
?>

I also have a comment, this is more like a personal preference than anything else so you can perfectly ignore this comment but wouldn't be beter if the menu items defined by your module are more drupal compliant, such as:

uc_protx_vsp_direct_3DSecure_callback could be for example uc_protx_vsp_direct/3DSecure_callback

So far, except the secure3D thing everything seems to work fine, I'll get back to you if I detect anything else or with any other, hopefully contructive comment.

Thanks a lot for contributing the module, so far it looks both working great and with great flexibilty.

a.=

Posts: 13
Joined: 05/30/2008

Just for information, Lemonbiscuit has just updated the VSP forms module and it works a treat!

Posts: 56
Joined: 04/20/2008
Bug FinderGetting busy with the Ubercode.

Hanoii,

Thanks for your comments, and apologies for not getting back to you sooner (I thought I was subscribed to this thread, but evidently not!).

I've changed the TermUrl code and 3D-Secure menu paths as you suggest.

Re: AUTHENTICATE and DEFERRED, I don't see how these could be intergrated into Ubercart. Anyone using Protx can do these sorts of transactions directly at the Protx website.

Re: Storing information, this is stored in "the Ubercart way" in an order comment (uc_order_comment_save()). It stores all the info that should be stored: VPSTxId, SecurityKey, TxAuthNo, AVSCV2, AddressResult, PostCodeResult, CV2Result, 3DSecureStatus. All other useful information is already stored by Ubercart, so I'm not sure what you mean.

Am re-applying for a Drupal CVS account now, and attach v1.01 of the module.

Ian

AttachmentSize
uc_protx_vsp_direct.zip40.29 KB
Posts: 27
Joined: 07/30/2008

Thanks for taking in my comments.

I noticed where you were storing the information from protx a little while after I posted my previous comment. That's perfect for now, but I still need to see how that data is available in case I work out somehow the AUTHENTICATE/AUTHORIZE part. I posted some ideas about implementing that in another post without any response yet. The post is http://www.ubercart.org/forum/development/5922/authenticateon_checkoutau...

I am probably adding a configuration entry to the gateway settings function so you can select between PAYMENT or AUTHENTICATE as a first step to handling AUTHENTICATE in your module.

I reviewed your new module code and so far I have one more comment.

I noticed you added base_path() to all of your drupal_goto() calls. drupal_goto() takes a drupal path as an argument, or a full URL, and a drupal path is just the path without anything else as you have it before or a full 'http://www.example.com' URL.

So for instance:

<?php
  drupal_goto
( base_path() . 'cart/checkout' );
?>

Should be set back to:

<?php
  drupal_goto
( 'cart/checkout' );
?>

As you had before.

Posts: 56
Joined: 04/20/2008
Bug FinderGetting busy with the Ubercode.

B***er, you're absolutely right about those drupal_goto()s. There was a problem with the new URLs that made me think drupal_goto() ought to have DOCUMENT_ROOT based paths -- I should have simply edited the following on line 541:
$output = '<html><head><title></title></head><body onload="document.forms[0].submit();"><form name="uc_protx_vsp_direct_3dsecure" method="post" action="'.$redirect.'" target="_top"></body></html>
to
$output = '<html><head><title></title></head><body onload="document.forms[0].submit();"><form name="uc_protx_vsp_direct_3dsecure" method="post" action="'.url($redirect, null, null, true).'" target="_top"></body></html>

You'll see this in v1.02 (soon to be uploaded to the new project page at http://drupal.org/project/uc_protx_vsp_direct). I hope you don't mind I've noted your contributions in the file header.

Good luck with the AUTHENTICATE thing. It's not something I care about personally (I have too many other projects on the go), but if you wish to incorporate it into the module then I'll do my best to accommodate.

AttachmentSize
uc_protx_vsp_direct.zip40.32 KB
Posts: 27
Joined: 07/30/2008

I don't mind at all Smiling Once your project got submitted I will probably start posting patches/suggestion in drupal.org. If at sometime you feel comfortable wiht my suggestion or you want to co-maintain that module I would be happy to commit things directly.

Anyway, just a few more comments in the line of the last fixes with url(), base_path() and stuff.

  • Line 533:
  • <?php
        $redirect
    = base_path() . 'cart/checkout/complete';
    ?>

    to
    <?php
        $redirect
    = 'cart/checkout/complete';
    ?>

     

  • Line 537:
  • <?php
        $redirect
    = base_path() . 'cart/checkout';
    ?>

    to
    <?php
        $redirect
    = 'cart/checkout';
    ?>

     

  • Line 462 and line 541:
  • <?php
                
    <iframe name="Secure3D" id="Secure3D" src="'.base_path().'uc_protx_vsp_direct/3DSecure_waitingPage">
    ?>

    <?php
        $output
    = '<html><head><title></title></head><body onload="document.forms[0].submit();"><form name="uc_protx_vsp_direct_3dsecure" method="post" action="'.url($redirect, null, null, true).'" target="_top"></body></html>
    ?>

    I do think that using url() as you did in this last version for line 541 is the way to go and the same thing should be done to line 462. Just one question, why did you pass the absolute value to TRUE? Does it need to be an absolute URL? Anyway, I am almost sure that using a plain url() would work.

    <?php
                
    <iframe name="Secure3D" id="Secure3D" src="'.url('uc_protx_vsp_direct/3DSecure_waitingPage').'">
    ?>

    <?php
        $output
    = '<html><head><title></title></head><body onload="document.forms[0].submit();"><form name="uc_protx_vsp_direct_3dsecure" method="post" action="'.url($redirect).'" target="_top"></body></html>
    ?>

Posts: 56
Joined: 04/20/2008
Bug FinderGetting busy with the Ubercode.

I thought I changed the ones on lines 533 and 537. Funny. Have taken on board your other points.

Also I've made a few other changes so as to better conform to Drupal's coding standards.

Will let you know when I release this version on drupal.org.

AttachmentSize
uc_protx_vsp_direct.zip40.29 KB
Posts: 56
Joined: 04/20/2008
Bug FinderGetting busy with the Ubercode.

There is now an official release at http://drupal.org/project/uc_protx_vsp_direct

hanoii -- you have CVS access. Enjoy!

There's a reference to the project here too, at http://www.ubercart.org/contrib/5990, but please submit bug reports via the d.o project page.

Posts: 27
Joined: 07/30/2008

Thanks for the cvs access Smiling I'll probably be contacting you through that project page from now on...

I have been on a small vacation trip so that's why I haven't been much in touch but I have still work to do on protx and I'll contrib as much as I can to your module.

a.=