CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Language and Locality »
  • UK Users Group (Moderator: Michael McAndrew) »
  • Issues for the Sagepay Payment Extension
Pages: [1] 2 3 4

Author Topic: Issues for the Sagepay Payment Extension  (Read 27875 times)

andyw

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 4
  • CiviCRM version: 4.x
  • CMS version: Drupal, Joomla
Issues for the Sagepay Payment Extension
September 26, 2012, 04:38:50 pm
Please post any issues relating to Circle Interactive's Sagepay payment extension here (as opposed to here if possible).

Many thanks!

Andy
Andrew Walker, Developer at Circle Interactive

edc1

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
  • CiviCRM version: 4.2.6
  • CMS version: Drupal 6
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Issues for the Sagepay Payment Extension
October 05, 2012, 02:39:39 pm
Hello,

I'm having real trouble with the SagePay integration and CiviCRM 4.2.2. This is what I get in the Apache log:

Code: [Select]
[Fri Oct 05 22:34:54 2012] [error] [client 78.86.163.23] PHP Fatal error:  Uncaught exception 'Exception' with message 'A fatal error was triggered'
in /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php:262\nStack trace:\n#0
/var/www/html/sites/all/civicrm_extensions/uk.co.circleinteractive.payment.sagepay/sagepay.php(398): CRM_Core_Error::fatal('The following e...')\n#1
/var/www/html/sites/all/modules/civicrm/CRM/Member/BAO/Membership.php(1400): uk_co_circleinteractive_payment_sagepay->doTransferCheckout(Array,
'contribute')\n#2 /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(896): CRM_Member_BAO_Membership-
>postProcessMembership(Array, '5', Object(CRM_Contribute_Form_Contribution_Confirm), Array, Array, Array)\n#3
/var/www/html/sites/all/modules/civicrm/CRM/Core/Form.php(246): CRM_Contribute_Form_Contribution_Confirm->postProcess()\n#4
/var/www/html/sites/all/modules/civicrm/CRM/Core/StateMachine.php(159): CRM_Core_Form->mainProcess()\n#5
/var/www/html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(60): CRM_Core_StateMachine->per in
/var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php on line 262, referer: http://78.86.163.23/civicrm/contribute/transact?
_qf_Confirm_display=true&qfKey=1aa5a6141f85aec3f68d7346cc42d522_1126

I can't seem to get a full back trace either if I have the debugging options enabled in CiviCRM because PHP (5.3.17) gives up. Any pointers on how to troubleshoot this?

Em.

edc1

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
  • CiviCRM version: 4.2.6
  • CMS version: Drupal 6
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Issues for the Sagepay Payment Extension
October 05, 2012, 02:50:22 pm
I should have said... This happens when I click the 'Continue >>' button when trying to renew a membership. I should be taken to the SagePay site but instead I get the error above in the Apache log, a 500 Internal Server error send back to the client and this URL in the browser window 'http://78.86.163.23/civicrm/contribute/transact'.

Em.

edc1

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
  • CiviCRM version: 4.2.6
  • CMS version: Drupal 6
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Issues for the Sagepay Payment Extension
October 08, 2012, 12:17:36 am
PHP fatal errors are caused under these circumstances:

The following errors occurred when submitting payment to Sage Pay:<br />3078 : The CustomerEMail format is invalid.<br />Please contact the site administrator.
The following errors occurred when submitting payment to Sage Pay:<br />4000 : The VendorName is invalid or the account is not active.<br />Please contact the site administrator.
The following errors occurred when submitting payment to Sage Pay:<br />Missing address field(s).<br /><br />Please contact the site administrator.
The following errors occurred when submitting payment to Sage Pay:<br />The CustomerEmail supplied is Invalid.<br />Please contact the site administrator.

Em.

andyw

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 4
  • CiviCRM version: 4.x
  • CMS version: Drupal, Joomla
Re: Issues for the Sagepay Payment Extension
October 08, 2012, 01:47:10 am
Hi Em,

I'll take a look into this - so just to clarify, you're trying to renew an existing membership, and getting the errors above in your error log when your click 'Continue >>', rather than being redirected to the Sagepay site?

I just wanted to check, as I'm unsure on how you would manage to get all four of these errors at once - you should only ever receive one at a time.

And you're using Civi 4.2 on Drupal 6?

Many thanks - if you could let me know about that, I'll try and reproduce your problem at our end.

Andy
Andrew Walker, Developer at Circle Interactive

edc1

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
  • CiviCRM version: 4.2.6
  • CMS version: Drupal 6
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Issues for the Sagepay Payment Extension
October 08, 2012, 04:14:05 am
Hi Andy,

that's right I'm renewing a membership. When I click the Continue >> button on the confirmation page that's when I get the PHP fatal error in the Apache error log. This is the point where I'd expect to be taken to the SagePay site, but I just see a blank white page on the client browser.

The error message doesn't make it in to the Apache error log. The way I managed to view the error message was to put a:

Code: [Select]
dpm($errmsg);
just before line 398 of /var/www/html/sites/all/civicrm_extensions/uk.co.circleinteractive.payment.sagepay/sagepay.php. If I go back in the browser after the error happens and then click the Back button, the error message gets displayed by the Drupal Devel module.

I'm not getting all of those errors at once. They've happened at different times. But I've seen the same PHP fatal error when the contents of $errmsg has been set to any of those values.

I'm using CiviCRM 4.2.2 on top of Drupal 6.26. PHP is version 5.3.17.

Really appreciate you having a look. Thanks Andy.

Em.

andyw

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 4
  • CiviCRM version: 4.x
  • CMS version: Drupal, Joomla
Re: Issues for the Sagepay Payment Extension
October 08, 2012, 04:51:30 am
Hi Em,

Quote
The error message doesn't make it in to the Apache error log.

Yes, you should find these in the log stored in ConfigAndLog, as it's not a php error that gets generated, it's a CRM error. These used to always be displayed on-screen, but I think some recent changes into how Civi errors are handled has caused this to change (or do you need to enable Debugging under the Debugging settings maybe?).

So it seems like the right type of error to be generating, but we might need to rethink that if it's going to make the errors a pain to access.

I will look into your problems with the membership renewals anyway, and get back to you.

Andy
« Last Edit: October 08, 2012, 04:56:01 am by andyw »
Andrew Walker, Developer at Circle Interactive

andyw

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 4
  • CiviCRM version: 4.x
  • CMS version: Drupal, Joomla
Re: Issues for the Sagepay Payment Extension
October 08, 2012, 08:21:52 am
Hi again,

Membership renewals do seem to work ok at my end, however I am noticing the same lack of errors when something goes wrong. I suspect something isn't quite setup correctly at your end, but you're not getting any useful information back on the cause of the problem.

I will probably need to investigate that further, but I think that's most likely a problem that's been introduced into core, as the code that logs those errors hasn't changed recently, and always worked before.

However, if you locate sagepay.php - this is in <your extension directory>/uk.co.circleinteractive.payment.sagepay

The first line of the file reads:

Code: [Select]
define('SAGEPAY_LOGGING_LEVEL', 1);
Change that to:

Code: [Select]
define('SAGEPAY_LOGGING_LEVEL', 4);
Then that should cause something useful to be printed into Drupal's 'Recent Log Messages' if any errors occur. That is more of a development aid that got left in there, but it should prove useful for debugging your problem.

In particular, after a failed renewal has occurred, do you see a message in there that says: civicrm_sagepay - Sending registration post?

If so, there should be a corresponding 'civicrm_sagepay - Registration post response' message with some information about what went wrong.

This is likely to be something about missing address data or an invalid ip if so - but let me know how you get on, and if you're able to find out any more information about the problem you're getting.

Hope that helps a bit,

Andy



« Last Edit: October 08, 2012, 08:43:57 am by andyw »
Andrew Walker, Developer at Circle Interactive

edc1

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
  • CiviCRM version: 4.2.6
  • CMS version: Drupal 6
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Issues for the Sagepay Payment Extension
October 08, 2012, 10:59:50 am
Hi Andy,

with the logging level set to 4 I get the error messages showing up in the Drupal log. And I get the 'Sending registration post' and 'Registration post response' messages:

Code: [Select]
Oct  8 18:31:04 wwrctest drupal: http://78.86.163.23|1349717464|civicrm_sagepay|78.86.163.23|http://78.86.163.23/civicrm/contribute/transact|http://78.86.163.23/civicrm/contribute/transact?_qf_Confirm_display=true&qfKey=32449f775b9f4df0f0faf70ff18a3e16_3154|6||
Sending registration post. Params = Array (     [Vendor] => wwrc     [VPSProtocol] => 2.23     [TxType] => PAYMENT     [VendorTxCode] => c96998e16825c6411656da70103860ff     [Amount] => 33.00     [Currency] => GBP     [Description] => Online Contribution: Renew Membership     [NotificationURL] => http://78.86.163.23/civicrm/payment/ipn?processor_name=Sagepay&cid=6&conid=117&mo=contribute&v=wwrc&qf=32449f775b9f4df0f0faf70ff18a3e16_3154&mid=1271&     [FailureURL] => http://78.86.163.23/civicrm/payment/ipn?processor_name=Sagepay&cid=6&conid=117&mo=contribute&v=wwrc&qf=32449f775b9f4df0f0faf70ff18a3e16_3154&mid=1271&     [BillingFirstnames] => Test     [BillingSurname] => User     [BillingAddress1] =>      [BillingCity] => London     [BillingPostCode] =>

Code: [Select]
Oct  8 18:31:04 wwrctest drupal: http://78.86.163.23|1349717464|civicrm_sagepay|78.86.163.23|http://78.86.163.23/civicrm/contribute/transact|http://78.86.163.23/civicrm/contribute/transact?_qf_Confirm_display=true&qfKey=32449f775b9f4df0f0faf70ff18a3e16_3154|6||
Registration post response. Response = Array (     [VPSProtocol] => 2.23     [Status] => INVALID     [StatusDetail] => The data in the BillingAddress1 field you supplied is an invalid format. It May either contain invalid characters or is more than Max 100 characters )

So that specific problem was due to me having the wrong fields on the profile form I had attached to the contribution page. So it does all work if I give it the right data. I'm not sure why it causes a PHP Fatal Error though if some of the data is wrong. On your setup if you send an empty parameter to the SagePay extension do you not get a PHP Fatal Error? Do you get something returned to the client browser? Maybe it's my version of PHP. I'm running 5.3.17 which is the latest version of 5.3. What version are you using? I can compile that version up and see if the behaviour changes.

Thanks again.

Em.

andyw

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 4
  • CiviCRM version: 4.x
  • CMS version: Drupal, Joomla
Re: Issues for the Sagepay Payment Extension
October 08, 2012, 01:03:58 pm
Hi Em,

Yes, I double checked that more carefully and found I was getting the same error as you in the Apache error log, so went off and investigated that ...

What is happening is CRM_Core_Error::fatal now performs an initial check on a member variable called $modeException, and if that's set to true (or something that evaluates to true), it decides to throw a PHP exception instead, and therefore you get the white screen of death, and the actual error you were trying to log gets discarded in the process.

I wasn't really able to find out the what the wisdom behind this is, there's a bit of a conversation in the IRC logs about it here:

http://irc.civicrm.org/logs/2012/%23civicrm.log.2012-04-06.txt

It seems that it's maybe under the impression it's being called by the API, and it would therefore be an excellent idea to replace the error you were trying to log in the correct log with a really unhelpful one in the wrong log. I'm not too sure what they're trying to achieve there, but I was able to add some code to the extension to override this setting before calling CRM_Core_Error::fatal().

So I've done that and uploaded a new version of the extension to here:

http://extensions.circle-interactive.co.uk/uk.co.circleinteractive.payment.sagepay.zip

If you download that, unzip it, and replace the sagepay files with the ones in there, that should solve the problem, and you should get helpful errors displayed on-screen again, which is how it is supposed to work.

Hope that solves your problems!

Andy
Andrew Walker, Developer at Circle Interactive

edc1

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
  • CiviCRM version: 4.2.6
  • CMS version: Drupal 6
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Issues for the Sagepay Payment Extension
October 08, 2012, 03:29:55 pm
Top man! Thanks Andy.

That does indeed fix things. I get the error message displayed at the client now rather than a white screen. And no PHP Fatal Error in the Apache log.

Thanks again.

Em.

Generic

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 4
  • CiviCRM version: 4.2.*, 4.5.*
  • CMS version: Joomla 2.5.*
  • MySQL version: 5.1.*
  • PHP version: 5.3.*
Re: Issues for the Sagepay Payment Extension
October 16, 2012, 09:39:13 am
Hi Andy

The cached xml file for the extension needs updating to match the info.xml, civi throws a mismatch error during install. I managed to force it by editing extensions/cache/uk.co.circleinteractive.payment.sagepay.xml before committing the install.

Generic
Document everything!
Zim-Wiki

wmason

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.2.4
  • CMS version: Wordpress 3.4.2
  • MySQL version: 5.1.65-cll
  • PHP version: 5.3.18
Re: Issues for the Sagepay Payment Extension
November 17, 2012, 10:32:29 am
I'm having the same difficulty that Generic ran into.  Unfortunately, I don't have sufficient privileges on the server (which is shared) to edit the version listed in the XML file.  Is there another workaround that I can employ?  Or will the cached file be updated soon?

Thanks.

Bill M.

andyw

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 4
  • CiviCRM version: 4.x
  • CMS version: Drupal, Joomla
Re: Issues for the Sagepay Payment Extension
November 19, 2012, 03:56:12 am
Hi Bill,

Apologies for this - I am currently trying to get this sorted, but unfortunately updating the extension release on civicrm.org seems to have caused an error on the extensions page.

Sorry about that - I thought it would most likely end in a catastrophe, so had been putting the job off :(

I've reported the issue anyway - so I'll let you know if/when there's any update on that.

Andy
Andrew Walker, Developer at Circle Interactive

Generic

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 4
  • CiviCRM version: 4.2.*, 4.5.*
  • CMS version: Joomla 2.5.*
  • MySQL version: 5.1.*
  • PHP version: 5.3.*
Re: Issues for the Sagepay Payment Extension
November 19, 2012, 04:10:43 am
Hi Bill

This is a problem with system generated/downloaded files on shared hosting as the permissions will be either root or apache.

Some options if you want to try and get round it before Andy has updated the extension.
1. Use a php script or php file manager to change the permissions of the file (remember to remove these php files after)
2. Download, save then edit the file and upload to see if it will let you write over it with you usual ftp login, sometimes works.
3. Ask your hosting provider to change the permissions, they're usually pretty quick at this.

Generic
Document everything!
Zim-Wiki

Pages: [1] 2 3 4
  • CiviCRM Community Forums (archive) »
  • Language and Locality »
  • UK Users Group (Moderator: Michael McAndrew) »
  • Issues for the Sagepay Payment Extension

This forum was archived on 2017-11-26.