News:

Support the VirtueMart project and become a member

Main Menu

ProtX

Started by Rob, September 09, 2004, 18:44:00 PM

Previous topic - Next topic

baggiesmad

any news on this yet?

jaddi01

I'm in the process of making a working Protx / SagePay module for the latest Joomla 1.5.10 and Virtuemart 1.13.  So far so good.  Transactions are being processed and redirects are working too.  I am facing a few small issues though.

1) How can I pass on the shipping information to Sagepay?  I have fields that send the billing name and address and also fileds that will be accepted fro SagePAy for shipping data, but I need to know the corrosponding variable in Virtuemart and how to catch them in the order process for sending.  This is an issue where the billing address is different to the shipping address.  Up until now only the billing address has been passed on, which I have duplicated for the shipping address giving the customer a receipt with the same address for both.

2) How the heck do I stop Virtuemart from sending an order confirmation email when directing to SagePay?  This is annoying.  The best solution would be to send a confirmation email AFTER the transaction has completed (or not as the case may be).

So if you guys have any ideas?  I'll continue working on this and I'll happily post my files when I've got them up and running.

John


jaddi01

Getting closer to solving the confirmation email issues with the help of this thread http://forum.virtuemart.net/index.php?topic=39534.60 .  Still need to get my head around the shipping address >-- SagePay issue.  I'll work on that today.

jaddi01

#138
Shipping info is now being passed on to SagePay.  I figured it out this morning, and then ironically read a post from Peter Clements in this thread detailing the same fix!  Anyway, all seems to be working well.  All I need to do now is change the references displayed to SagePay and not Protx and continue tweaking the confirmation emails with the help of the aforementioned thread.

I'll change the headers on the files to make them work natively with Joomla 1.5 when I'm happy that it is 100%.

*EDIT*

Finished.  Joomla 1.5 Native, Virtuemart 1.1.3, SagePay VSP.

Download Here:

[attachment cleanup by admin]

baggiesmad

Quote from: jaddi01 on May 18, 2009, 15:58:41 PM
Shipping info is now being passed on to SagePay.  I figured it out this morning, and then ironically read a post from Peter Clements in this thread detailing the same fix!  Anyway, all seems to be working well.  All I need to do now is change the references displayed to SagePay and not Protx and continue tweaking the confirmation emails with the help of the aforementioned thread.

I'll change the headers on the files to make them work natively with Joomla 1.5 when I'm happy that it is 100%.

*EDIT*

Finished.  Joomla 1.5 Native, Virtuemart 1.1.3, SagePay VSP.

Download Here:

Hi jaddi01

Does this mod now work with the latest version of joomla and virtuemart?

jaddi01

Hi Vanqush,

yes it does.  You do need to modify the CFG file with your own settings (I've set it to the protx test site, just uncomment the right one), but yes works for me. 

baggiesmad

Quote from: jaddi01 on June 01, 2009, 12:13:30 PM
Hi Vanqush,

yes it does.  You do need to modify the CFG file with your own settings (I've set it to the protx test site, just uncomment the right one), but yes works for me.  

ok thanks will try it on my site this week.

has there been many changes from the original Protx payment method and the new Sagepay system?

jaddi01

No not really.  SagePAy didn't like the address variables being sent all in one string, so that had to be changed, but as far as the look and feel for the customer, I find it slightly better than the ol' Protx.

essexboyupnorth

Just wanted to say thanks to Chris Stead and others who have contributed to this thread.

I have managed to get the Chris Stead Method to work with Sage Pay (Formerly Protx), VM 1.1.3 and Joomla 1.15.10, I've had to tweak a couple of things but thankfully nothing major as I have no PHP experience. I've been testing on a live system using a real credit card and a test product costing 0.01p. Here are my steps:

1) Use the Chris Stead Method as quoted in reply #22. When you set up the new payment method, before you can edit the configuration page you have to save and re-enter the payment method you've just created, you will then get a form to fill out in the configuration tab.

2) Fill out the configuration form as Chris suggests, I entered 2.2 in the VPS Protocol version field, live.sagepay.com in the hostname of the secure URL field and /gateway/service/vspform-register.vsp in the path of the secure URL field. Make sure you add your .com, .co.uk, .org to http://www.yourdomain in the success and failure url.

3)The pathway to the english.php file seems to have changed since Chris created his method so I changed the code in checkout.protx_cpi_result.php file on line 35 from:

// load Mambo Language File
    if (file_exists( $mosConfig_absolute_path. '/language/'.$mosConfig_lang.'.php' )){
      require_once( $mosConfig_absolute_path. '/language/'.$mosConfig_lang.'.php' );
    } else {
      require_once( $mosConfig_absolute_path. '/language/english.php' );
    }

to:

// load Mambo Language File
    if (file_exists( $mosConfig_absolute_path. '/languages/'.$mosConfig_lang.'.php' )){
      require_once( $mosConfig_absolute_path. '/languages/'.$mosConfig_lang.'.php' );
    } else {
      require_once( $mosConfig_absolute_path. '/administrator/components/com_virtuemart/languages/common/english.php' );
    }


and changed the code on line 54 from:

} else {
      require_once( ADMINPATH. 'languages/english.php' );
    }


to:

} else {
      require_once( ADMINPATH. 'languages/common/english.php' );
    }


This gave me a blank page from my own website and the order in VM was left as pending and not confirmed, not great but better than the errors I was getting.

4) The next step sorts out the blank page and the order status. Take the code in reply #77 of this thread and paste it as instructed into the checkout.protx_cpi_result.php to stop the gaps in url returned from Sage Pay being filled with %20, the order status should change from pending to confirmed in VM's orders section with a successful transaction.

I still need to work on a Thank You message and a link to the order details page but the camel's back is broken. Thanks to all who contribute to these forums, a novice half wit like me wouldn't stand a chance without you.
I am a VM dwarf, but I stand on the shoulders of giants.

jaddi01

Hello essexboyupnorth

why didn't you just download my finished version that resolves all of the problems you mention posted 3 posts up?

essexboyupnorth

Quote from: jaddi01 on June 04, 2009, 11:12:28 AM
Hello essexboyupnorth

why didn't you just download my finished version that resolves all of the problems you mention posted 3 posts up?

Sometimes it's difficult to spot when the specific problems you encounter are the same as those that have been solved when the wording in a post doesn't seem quite relevant to your own issue, also with 10 pages of thread finding the answers isn't always straight forward.

I thought I'd post the steps an utter php numpty took to get Sage Pay working in the latest of Joomla and Virtuemart in the hope it helps someone else in a similar situation.

Maybe we need a thread called THE PROTX / SAGE PAY SOLUTION with your finished version in. Unless you shout about it people won't hear. I know that when I find a solution to a problem I try to post it in as many relevant threads as I can.

Thanks for the heads up, I'll download your solution and take a look, I'm sure it's far more elegant than mine.
I am a VM dwarf, but I stand on the shoulders of giants.

3cellhosting

Hi jaddi01,

Downloaded files. Uploaded to site as shown in readme.txt.

Create new payment - cannot enter Payment class name: ps_protx_cpi as this is a dropdown and this does not appear as one of the selections.

As a default I selected the option ps_payment but this would not save as a payment option. I started with 15 options and still have 15 options.

I am running Joomla 1.5.11 and VM 1.1.3

Quote from: jaddi01 on May 18, 2009, 15:58:41 PM

Finished.  Joomla 1.5 Native, Virtuemart 1.1.3, SagePay VSP.

Download Here:

Many thanks

David

jaddi01

Hello 3cellhosting

yes the ps_prox will not appear unless you have already uploaded the files to the correct locations.  Then I would suggest entering and modifying the ps_protx_cpi.cfg.php file directly (that's what I did) using a text editor like notepad.

bobbie_bobster

Quote from: jaddi01 on May 18, 2009, 15:58:41 PM
Shipping info is now being passed on to SagePay.  I figured it out this morning, and then ironically read a post from Peter Clements in this thread detailing the same fix!  Anyway, all seems to be working well.  All I need to do now is change the references displayed to SagePay and not Protx and continue tweaking the confirmation emails with the help of the aforementioned thread.

I'll change the headers on the files to make them work natively with Joomla 1.5 when I'm happy that it is 100%.

*EDIT*

Finished.  Joomla 1.5 Native, Virtuemart 1.1.3, SagePay VSP.

Download Here:

Was having trouble getting the confirmation page to work on this setup, but then noticed that although the notes.txt file in the zip says to upload /administrator/components/com_virtuemart/html/protx_functions.php, I was getting a php error trying to reference /administrator/includes/protx_functions.php.

Moved the file and all is OK now.

Many thanks to all contributors to this solution, what I though might have been 3-4 days of work was reduced to a couple of hours.

freshwebservices

Hi Guys,
Thanks for all the work you've put into this to date.

I'm new to VM, so be warned! I've installed & configured the Protx (SagePay) module as instructed in the zip file.

Its showing as a payment method but I have a couple of Qs/issues:
1) It only shows the card entry fields if the default Credit Card method is also active. This will be confusing to users who will select this option by default I believe. If I disable this method, then the SagePay only shows as a radio button - & there's no form to fill in their card details.
2)How can I set the Sage status - test, stimulator, live, etc?
3) Is there something else that I need to do before this payment method can be used - do I have to code a thank you page or anything like that?

Thanks,
Eddie
Leicester Joomla & Magento developer