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) »
  • UK payment processors
Pages: 1 ... 5 6 [7] 8

Author Topic: UK payment processors  (Read 59050 times)

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: UK payment processors
April 19, 2012, 10:47:19 am
Thanks for that Andy, yes I was not using (Home) address.

I can however set the address I want to use as default in location types to get it working. Its still a bit weird that it will allow non default addresses to go through once they are a contact (contact is added even if payment fails so 2nd attempt works)

I Guess CiviCRM API is using some sort of hierarchy to find other addresses (if the default is empty) when a contact is already present.

Might be an issue with API so I will bring it up in the IRC.

Generic
Document everything!
Zim-Wiki

andyw

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 4
  • CiviCRM version: 4.x
  • CMS version: Drupal, Joomla
Re: UK payment processors
April 25, 2012, 02:01:15 am
Hi Generic,

Thanks for the info on that, and let me know if you find out anything more as regards addresses and the API. Like I say, if there's some way we can improve that, that is something we'd certainly be willing to look at.

All the best!

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: UK payment processors
August 31, 2012, 03:42:29 am
Hi Andy

I have finally got round to testing CiviCRM 4.2 (Joomla) the SagePay payment processor was throwing 500 errors so I had a look at the changes introduced to the Paypal processor and edited the SagePay where the code was the same.

All works fine for events (returns to thank you) and the payment processes for contribute/membership but this returns to the membership/contribute form instead of the thank you page.

Please find patch file attached, I can email the zip if you prefer.

Generic
Document everything!
Zim-Wiki

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: UK payment processors
September 04, 2012, 10:03:48 am
Since my last post I have found the SagePay extension for 4.2. http://civicrm.org/extensions/sagepay-payment-processor
However I haven't been able to get this to work without 500 errors.

I did remove the same 'require_once' that had been changed in PayPal standard which is packaged with 4.2 this allowed me through to SagePay test to make a payment but cancel or thank you returns are not being push through.

Code: [Select]
Unable to redirect to Vendor's web site. The Vendor failed to provide a RedirectionURL
Document everything!
Zim-Wiki

andyw

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 4
  • CiviCRM version: 4.x
  • CMS version: Drupal, Joomla
Re: UK payment processors
September 05, 2012, 02:38:05 am
Hi Generic,

Yes, the extension is probably the way to go on 4.2+, but it is quite new, and I hadn't had a chance to update our website yet to let people know about it. So apologies for that.

Many thanks for your patch against the old version though - I will apply that and get an updated version up there. It's a bit difficult to see exactly what you changed, as the patch contains a lot of diff noise - so it'd be good maybe have a chat about that and find out what you changed via P/M sometime.

We want to keep supporting the old version for a while for anybody who can't / doesn't want to use the extension, so it would be good to get your changes in there, and ensure that continues to work on Joomla and Civi 4.2.

With regard to the problem you're getting with the RedirectionURL, I would take a look at the following line, near the bottom of ipn.php ...

Code: [Select]
$returnURL = CRM_Utils_System::url($url, "_qf_ThankYou_display=1&qfKey=" . SAGEPAY_QFKEY, true, null, false, true);
I remember changing the arguments of that function call to achieve something or the other, possibly Joomla related - I will try and look into that and find out what's going wrong for you there, but I suspect one of the  true, null, false, true arguments is causing the problem.

So I'll take a look into that and get back to you (hopefully) shortly - but if you're maybe able to log anything out at that point, eg:

Code: [Select]
file_put_contents('/tmp/sagepay-debug', "RedirectURL=$returnURL");
.. or find out any more about your problem, that would be really great.

Sorry you seem to having difficulties with it though,

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: UK payment processors
September 05, 2012, 05:48:20 pm
Hi Andy

Thanks for the reply.

RE: Non Extension Version
I put the file_put after each echo and could only get a log when I forced a cancel.

RE: Extension Version
Discovered that the 500 errors were because the table and fields were not written at install because civicrm_sagepay table was already present from the previous version, a suggestion would be to rename the table e.g civicrm_sagepayext or add drop if exists to install code. I still can't get it to pass through any cancel or return url's to sage, see screenshot. If you could once again point me in the right direction I will try my best to debug.

Generic
Document everything!
Zim-Wiki

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: UK payment processors
September 07, 2012, 06:01:48 am
Hi Andy

I now have 4.2 Extension version working in Joomla.

Changed
Code: [Select]
notifyURL = $config->userFrameworkBaseURL . 'civicrm/payment/ipn?';
Joomla requires
Code: [Select]
$notifyURL = $config->userFrameworkBaseURL . 'index.php?option=com_civicrm&task=civicrm/payment/ipn&';
Not sure what we can use instead of userFrameworkBaseURL to be cross CMS compatible I guess a condition would work but I'm not familiar with any 'if joomla' I guess we could use $_GET['option'] == 'com_civicrm'

Regards
Generic
Document everything!
Zim-Wiki

andyw

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 4
  • CiviCRM version: 4.x
  • CMS version: Drupal, Joomla
Re: UK payment processors
September 07, 2012, 06:32:05 am
Hi Generic,

Thanks for looking into that - I installed Joomla / Civi 4.2 at this end and started looking into it, but ran into quite a few problems - I'm sure most of them probably caused by a lack of experience with Joomla, but anyway ...

It's good to know there's no problem with the civicrm/payment/ipn url in Joomla (mainly because I implemented that), but I did forget about the Joomla style urls when writing the Sagepay extension, so apologies for that.

In terms of detecting the user framework, I would try something along the lines of:

Code: [Select]
$config      = CRM_Core_Config::singleton();
$isDrupal    = $config->userSystem->is_drupal;
$isJoomla    = ucfirst($config->userFramework) == 'Joomla' ? TRUE : FALSE;
$isWordPress = $config->userFramework == 'WordPress' ? TRUE : FALSE;

which is from CMSUser.php - so should work.

Anyway, thanks for all your time and effort in solving these problems - if you're able to post any further patches, that would be really helpful - but either way, I'll get onto getting these changes made and getting a new version uploaded next week.

Many thanks again!

Andy
« Last Edit: September 07, 2012, 06:36:20 am by andyw »
Andrew Walker, Developer at Circle Interactive

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: UK payment processors
September 07, 2012, 07:41:58 am

hey andy:

You should use CRM_Utils_System::url( )

to form a url that will work across all CMS'es

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

andyw

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 4
  • CiviCRM version: 4.x
  • CMS version: Drupal, Joomla
Re: UK payment processors
September 07, 2012, 07:55:59 am
Hey lobo,

Ah, that'll be the way to do it then - thanks for that!

Look forward to seeing you at this code sprint that's coming up .. I've been told I have to attend :)

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: UK payment processors
September 07, 2012, 08:28:55 am
I did try that but it didn't like the concatenate plus we still need to change /ipn? to /ipn&

I have done this
Code: [Select]
if (ucfirst($config->userFramework) == 'Joomla') {
          $notifyURL = $config->userFrameworkBaseURL . 'index.php?option=com_civicrm&task=civicrm/payment/ipn&';
        } else {
          $notifyURL = $config->userFrameworkBaseURL . 'civicrm/payment/ipn?';
        }

The return url for a successful transaction is still not valid (same as the non extension version in 4.2 except sage now says no return url instead of returning to cancel) for contribute only, events is fine
Document everything!
Zim-Wiki

andyw

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 4
  • CiviCRM version: 4.x
  • CMS version: Drupal, Joomla
Re: UK payment processors
September 07, 2012, 08:59:27 am
Hi Generic,

Yes, lobo is saying it's best to use CRM_Utils_System::url(), as it's there to handle all the specifics of constructing urls across various UFs.

I haven't tested this, but would imagine changing:

Code: [Select]
// Construct notification url
$notifyURL = $config->userFrameworkBaseURL . 'civicrm/payment/ipn?';
foreach ($notifyParams as $key => $value)
    $notifyURL .= $key . '=' . urlencode($value) . '&';
$notifyURL = substr($notifyURL, 0, -1);

to something more like:

Code: [Select]
// Construct notification url
$querystring = '';
foreach ($notifyParams as $key => $value)
    $querystring .= $key . '=' . urlencode($value) . '&';
$notifyURL = CRM_Utils_System::url('civicrm/payment/ipn', $querystring, true, null, false, true);

would do the trick, but I will get that code properly tested, then release an updated version.

All the best,

Andy
« Last Edit: September 07, 2012, 09:03:31 am by andyw »
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: UK payment processors
September 07, 2012, 11:58:57 am
Hi Andy

No joy on the contribute/membership return I just get the Sagepay no return url error.
All the submissions look good and I'm quite confident the problem is not with the $returnURL I think it must be in the param or sfkey somewhere.

Generic
Document everything!
Zim-Wiki

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: UK payment processors
September 08, 2012, 04:02:11 am
Hi Andy

Please find attached my Notification URL info captured from Sagepay simulator for a contribution membership payment.

I've also noticed if I click refresh on the Sagepay error page I am returned to civicrm cancel url.

Generic
Document everything!
Zim-Wiki

andyw

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 4
  • CiviCRM version: 4.x
  • CMS version: Drupal, Joomla
Re: UK payment processors
September 12, 2012, 01:58:44 am
Hi Generic,

Just to let you know I'm still working on this - have uploaded a new version of the extension to:

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

.. which should solve the returnURL problem on Joomla, however I'm now getting a permissioning problem on the civicrm/payment/ipn url, which is odd, as that url shouldn't be permissioned at all .. and I'm also getting various unrelated Civi/Joomla problems, which I'll need to get to the bottom of and probably file some bug reports.

So I will keep working on this, but realistically, it's probably going to be next week before we get all of this resolved.

I hope that doesn't hold you up too much in whatever you're doing.

All the best,

Andy
Andrew Walker, Developer at Circle Interactive

Pages: 1 ... 5 6 [7] 8
  • CiviCRM Community Forums (archive) »
  • Language and Locality »
  • UK Users Group (Moderator: Michael McAndrew) »
  • UK payment processors

This forum was archived on 2017-11-26.