PrestaShop Forums: Sagepay - Updating Protx Form Module - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


Sagepay - Updating Protx Form Module


Sagepay - Updating Protx Form Module

#1 radders

    PrestaShop Apprentice

  • 19 Sep 2008
  • Members
  • PipPip
  • 255 posts

Posted 14 August 2009 - 09:53 AM

I have updated the Protx Form module to the latest Sagepay 2.23 protocol. The new version should work but please test before using and use at your own risk as usual. It is configured to use test server or sandbox. When ready to go live just edit the sagepay.php file to link to the live server instead of the test server.


What's new?

The server names logos and the protocol have been changed (anything with the word protx in it too).
The 2.23 protocol is required for sandbox testing.
Billing and delivery names and addresses use individual fields - first name, surname, address1 etc. rather than simply being an address block as previously.
Postcode is passed for UK addreses only.

To install, unzip this sagepay directory to your modules directory and configure with your Sagepay with your Sagepay details. This should not overwrite anything from your Protx module. It can run alongside.

(updated attachment)

I am no longer supporting this module. I recommend you use:
Sagepay Server (not free)

Attached File(s)



#2 celadore

    PrestaShop Newbie

  • 16 Aug 2009
  • Members
  • Pip
  • 1 posts

Posted 16 August 2009 - 01:27 PM

Am new to Prestashop. Love the look and feel, but was sad to see no Sage Pay option. But lo and behold someone is working on it.

When will you have a final working module. Is it going to be free or pay?

Thank you, thank you.

#3 radders

    PrestaShop Apprentice

  • 19 Sep 2008
  • Members
  • PipPip
  • 255 posts

Posted 16 August 2009 - 03:09 PM

It is free.

The original Protx form module may still work but would have needed updating sooner or later. I have just made some small changes to the original Protx module which I have also emailed to the original author.

I wasn't able to test out if 3D secure was working. Sometimes I don't see the popups for this sort of thing.

#4 Dennis Chan

    PrestaShop Newbie

  • 03 Aug 2009
  • Members
  • Pip
  • 6 posts

Posted 15 September 2009 - 10:27 AM

I was getting problem if the purchase more then £1000 pound, it went through Sage Pay successfully, but when return to Prestashop, it only show £1 of the order. And Prestashop will send out a notification letter said the order has error.

I did see the Protx direct contains this bugs before, not sure is it a bug on the SagePay Form module as well??

I look forward to hearing from you. Thank you.

#5 radders

    PrestaShop Apprentice

  • 19 Sep 2008
  • Members
  • PipPip
  • 255 posts

Posted 15 September 2009 - 10:58 AM

Probably Sagepay is returning £1,000.00 and the module is expecting £1000.00

Was the Protx direct module fixed?

#6 Dennis Chan

    PrestaShop Newbie

  • 03 Aug 2009
  • Members
  • Pip
  • 6 posts

Posted 15 September 2009 - 12:02 PM

Thanks for your reply.

Please See: http://www.prestasho...ad/16173/#73292

Quote

10th June 2009 – Bug fix release
Yet another couple of bug fixes.
It’s still (yes STILL) marked as the same version number. Two bug fixes don’t really count as much.

Orders over £1,000 now display correctly in the administration area.
Upgraded to work with the latest svn build as of 20 mins ago (yes this includes the latest downloadable beta).


I haven't do a test on the direct module. I can do a test if necessary.

Thank you.

#7 radders

    PrestaShop Apprentice

  • 19 Sep 2008
  • Members
  • PipPip
  • 255 posts

Posted 15 September 2009 - 02:06 PM

Thanks for spotting this one.

Unless you specify otherwise the function 'default number_format' uses a comma as the thousands separator so the fix would be to change line 266 of sagepay.php from

$cryptArr['Amount'] = number_format($params['cart']->getOrderTotal(),2);


to


$cryptArr['Amount'] = number_format($params['cart']->getOrderTotal(),2,'.','');


Does that fix the problem?

#8 Dennis Chan

    PrestaShop Newbie

  • 03 Aug 2009
  • Members
  • Pip
  • 6 posts

Posted 16 September 2009 - 10:05 AM

After I modified the Sagepay.php, every time when I went through Sagepay transaction, return to Prestashop, it will show a message "ammount - hacking attempt".

How can I deal with this problem?

Thank you.

#9 radders

    PrestaShop Apprentice

  • 19 Sep 2008
  • Members
  • PipPip
  • 255 posts

Posted 16 September 2009 - 12:33 PM

OK so that means that the amounts don't match. I will look to see what the amount is being checked against.

#10 Dennis Chan

    PrestaShop Newbie

  • 03 Aug 2009
  • Members
  • Pip
  • 6 posts

Posted 16 September 2009 - 12:48 PM

Many thx, I will look forward to see this bug fix.

It is a great module!

#11 radders

    PrestaShop Apprentice

  • 19 Sep 2008
  • Members
  • PipPip
  • 255 posts

Posted 17 September 2009 - 07:38 AM

I'm at loss to know what is happening here because when the amount is below 1,000 those two functions should be identitcal yet it seems from your post that they are yielding different results and generating the 'hacking attempt' error.

Unfortunately I don't have a test sytem available to me at the moment to run this through. Are the transactions being recorded correctly in Sagepay?

Can you echo the two variables that are being compared?

$decoded['Amount'] and $_SESSION['sagepay']['Amount']

#12 Dennis Chan

    PrestaShop Newbie

  • 03 Aug 2009
  • Members
  • Pip
  • 6 posts

Posted 17 September 2009 - 09:11 AM

Yes the transactions being recorded correctly in Sagepay.

How to echo those variables that are being compare?

I can see Sagepay Amount = "1,400.00 (GBP)"

But I just see "Total" at Prestashop back office admin panel.

Sorry for the ask, I am a newbie at Prestashop... :(

#13 radders

    PrestaShop Apprentice

  • 19 Sep 2008
  • Members
  • PipPip
  • 255 posts

Posted 17 September 2009 - 02:44 PM

In the file success.php of the sagepay subdirectory, above the line (21?):
     die('ammount - hacking attempt');    


put

echo 'decoded amount: '.$decoded['Amount'] . 'session amount: ' . $_SESSION['sagepay']['Amount'];


If we see that the only difference between these is a comma then perhaps inserting a line:

// next line added by to remove commas from amount
$decoded['Amount'] = str_replace(',','',$decoded['Amount']);


after
// a little bit of security please!


might do the trick.

#14 Dennis Chan

    PrestaShop Newbie

  • 03 Aug 2009
  • Members
  • Pip
  • 6 posts

Posted 17 September 2009 - 03:41 PM

after I do the echo on the test, result is:

"decoded amount: 1,400.00session amount: 1400.00ammount - hacking attempt"

so, I use your tricks to remove the ',', it works absolutely fine!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Thank you very much!!!!!

Many many thx!

#15 radders

    PrestaShop Apprentice

  • 19 Sep 2008
  • Members
  • PipPip
  • 255 posts

Posted 17 September 2009 - 04:14 PM

Glad to be of help and thanks again for the testing!

#16 paulthibedeau

    PrestaShop Newbie

  • 21 Sep 2009
  • Members
  • Pip
  • 1 posts

Posted 21 September 2009 - 08:53 PM

How can i make this work with "Sage Payment" the USA version of Sage Gateways??

PLEASE HELP, this module is the closet help I can get and I need to get this working.

#17 Floobynooby

    PrestaShop Apprentice

  • 14 Feb 2009
  • Members
  • PipPip
  • 56 posts

Posted 03 November 2009 - 02:10 PM

What versions of Prestashop does this module work with.

#18 radders

    PrestaShop Apprentice

  • 19 Sep 2008
  • Members
  • PipPip
  • 255 posts

Posted 03 November 2009 - 04:27 PM

I tested it on 1.2
I expect it will work on later versions though.

#19 Floobynooby

    PrestaShop Apprentice

  • 14 Feb 2009
  • Members
  • PipPip
  • 56 posts

Posted 03 November 2009 - 07:05 PM

Many thanks am using 1.1 at the moment but thinking of upgrading to 1.2.5 just wanted to check before upgrading or would stick with 1.1.

#20 sgtbash

    PrestaShop Apprentice

  • 08 Oct 2009
  • Members
  • PipPip
  • 98 posts
  • Location:Newquay, Cornwall, UK

Posted 26 November 2009 - 02:52 PM

Hi,

Thanks for the module, works like a dream!

One thing though - is there any way of using an order related variable instead of the 'Sagepay Order' text on line 272 of sagepay.php?

Id like to use something that matches the payment to the order.

Has an order number been generated at this point?

Thanks

Dan
Nineplus Wetsuits & Surfboards (Happily using PS)
Nineplus Australia First of our global sites to be moved from Actinic to PrestaShop





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users