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 ... 4 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 03, 2012, 10:20:32 am
I have this working in Joomla 2.5 and CiciCRM 4.1 however the return url is adding in 'administrator'

https://www.example.com/administrator/?option=com_civicrm&task=civicrm/event/register&_qf_Register_display=1&cancel=1&qfKey=a10391bafd5a49d6edf844d9a383a86f_1732

I understand this may be a Joomla specific bug.

I have added $returnURL = str_replace( 'administrator/', '', $returnURL ); to line 377 of SagePayServerNotify.php which has fixed it.

Thanks for this Payment Processor
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 04, 2012, 07:26:28 am
Thanks for the info on this, Generic.

Looks like the best way to fix this might be changing: (at line 374)

Code: [Select]
        $returnURL = CRM_Utils_System::url( $url,
                                            "_qf_ThankYou_display=1&qfKey=" . SAGEPAY_QFKEY,
                                            true, null, false);

to
Code: [Select]
        $returnURL = CRM_Utils_System::url( $url,
                                            "_qf_ThankYou_display=1&qfKey=" . SAGEPAY_QFKEY,
                                            true, null, false, true);

Seems like there's an optional sixth parameter for that function which makes everything work properly under Joomla when set to true, but I will get this fixed and the module updated, as it looks like it might need to be changed in several places for the cancel urls as well.

Also looks like the same problem might exist in the Paypal module (PayPalImpl.php - line 420):

Code: [Select]
        $returnURL = CRM_Utils_System::url( $url,
                                            "_qf_ThankYou_display=1&qfKey={$params['qfKey']}",
                                            true, null, false );

.. but I'm not really in a position to be able to test this at the moment unfortunately.

Many thanks!

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
April 04, 2012, 07:45:56 am
Thanks for taking a look so quick.

I can confirm the PayPal is working fine, I did also have a look in the PayPalImpl.php to see what that was doing. I think the following is the fix in PayPal but I haven't had time to try it.

Code: [Select]
// ensure that the returnURL is absolute.
        if ( substr( $returnURL, 0, 4 ) != 'http' ) {
            require_once 'CRM/Utils/System.php';
            $fixUrl = CRM_Utils_System::url("civicrm/admin/setting/url", '&reset=1');
            CRM_Core_Error::fatal( ts( 'Sending a relative URL to PayPalIPN is erroneous. Please make your resource URL (in <a href="%1">Administer CiviCRM &raquo; Global Settings &raquo; Resource URLs</a> ) complete.', array( 1 => $fixUrl ) ) );
        }

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 04, 2012, 08:55:32 am
No problem, that's all fixed and there's an updated version of the module available on the download page.

And thanks for looking at the Paypal one, I'm not quite sure what's going on there then - but as long as everything works, that's the main thing! :)

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
April 04, 2012, 02:56:17 pm
Thanks Andy that's brilliant.

http://www.circle-interactive.co.uk/help/civicrm/modules/sagepay
Document everything!
Zim-Wiki

iammikek

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 4.07
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5
Re: UK payment processors
April 16, 2012, 05:12:28 am
We've upgraded to the new sagepay for 4.1 and seem to be hitting a problem that was in the previous version.

if we set up a new registration for someone not in our civi contact database and submit the form we get:

Sorry. A non-recoverable error has occurred.
The following errors occurred when submitting payment to Sage Pay:
Missing address field(s).
Missing postcode field.
Missing country field.


When we set up the registration form we specified a full list of fields which we've called name and address. This fieldset includes the following fields.

First Name
(Individual)

Last Name
(Individual)   

Street Address (Main)
(Contact)

Second line of address (Main)
(Contact)

Third line of address (Main)
(Contact) 

City (Main)
(Contact)

State (Main)
(Contact)

Postal Code (Main)
(Contact)

Country (Main)
(Contact)

Phone Number
(Contact)

Email address
(Contact)   

Any ideas where the missing field data needs fetching from?


Regarding redirection URL, once payment has been taken i am being redirected back to my event page (with a link to register now) rather than the thankyou page.

this gives the following:
Oops. It looks like you are already registered for this event. If you want to change your registration, or you feel that you've gotten this message in error, please contact the site administrator. You can also register another participant. Any Way to tweak that to display the welcome page

Feels like this all should be pretty straight forward. Does anyone have advice that covers this?

thanks
mike

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 16, 2012, 06:18:14 am
Hi Mike

I have just noticed the non-recoverable error was happening the other day and am looking into it.

I have also had the return to register page which I found to be caused by the pdf generation failing (dompdf) and that was causing the wrong return page to be submitted to SagePay. Disable pdf generation in Administer > System Settings > Undelete, Logging and ReCaptcha (or misc as it was called) and see if you return to thank you page after payment.

Even though the process is failing CiviCRM will still register a participant so you will have to delete registered participants before you can register again. To avoid having to keep doing this you can use test drive mode in CiviCRM admin.

Generic
Document everything!
Zim-Wiki

iammikek

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 4.07
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5
Re: UK payment processors
April 16, 2012, 07:32:50 am
Hi Generic,
thanks for your reply.

regarding the pdf generation settings, i've not got pdf generation enabled - atleast Attach PDF copy to receipts is set to false.

I can see that the registrant is being added to the db so we're not loosing anything there, just a bit weird getting the oops message.

Will await to hear about the address format issue. Let me know if you want any help with the testing.

mike

andyw

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 4
  • CiviCRM version: 4.x
  • CMS version: Drupal, Joomla
Re: UK payment processors
April 16, 2012, 08:00:52 am
Hi Mike,

Address-wise, it is whatever the Contact API returns for street_address, city etc - location type 'Home' seems to do the trick here.

Maybe it should be doing something a bit different there, like checking the Billing location type first then falling back to 'Home' - I'm not too sure about that one really - it's always just used the address returned by the Contact API, and that seems to work ok in most cases (?)

Return URL wise, the url you're supposed to get sent to is:

/index.php?q=civicrm/event/register&_qf_ThankYou_display=1&qfKey=<your qfkey here>

so if you're ending up somewhere else that would point to a problem caused by DomPDF, as Generic says. I think we saw this on another site before, and it turned out that because the PDF generation is the last thing it does, the transaction record gets marked as complete in Civi, then it tries to generate a pdf, falls over, fails to reply and the transaction gets cancelled by Sagepay - so you end up with a transaction marked as complete in Civi and CANCELLED BY VENDOR at Sagepay. Not ideal.

.. if I recall correctly anyway - sound familiar?

Andy
Andrew Walker, Developer at Circle Interactive

andyw

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 4
  • CiviCRM version: 4.x
  • CMS version: Drupal, Joomla
Re: UK payment processors
April 16, 2012, 08:09:34 am
Sorry, I didn't see your reply about the return url ...

In which case, after you sign up, are you getting sent to the return url in my previous reply, or a different one?
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
April 16, 2012, 08:56:15 am
Hi Andy

Does the processor require the participant registering to already be a contact in CiviCRM, because this is what appears to be happening.

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 16, 2012, 10:05:13 am
Hi again Generic,

Well, they do have to have a contact record - but the profile you're using should create a contact record automatically when filled in, then a participant record linked to that and marked as 'Pending' - this then gets updated to 'Completed' once they've paid.

Alternatively, if they're a pre-existing contact and they're logged in, that profile should already be filled in with what they entered before, and will update the record when filled in.

Does that help? or am I misunderstanding you?

Are we definitely talking about a contact record, or a CMS user? CMS users are a bit different, but you can configure the profile to create one of those too if necessary.

Oh well, hope that helps! :)

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
April 16, 2012, 11:38:53 am
No I was referring to CiviCRM contact.

This is the error that Mike and I have experienced when registering a new participant (one not a civicrm contact)

CiviCRM-001 -
Sorry. A non-recoverable error has occurred.
The following errors occurred when submitting payment to Sage Pay:
Missing address field(s).
Missing postcode field.
Missing country field.

The new contact and participant will be entered to CiviCRM but the process is not happening before the details are passed to sage.
If you then remove the participant record but not the contact and re-register it will go through to sage.
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 16, 2012, 12:29:47 pm
Hi Generic,

Ok, my apologies - I understand what you're saying in which case.

However, I don't think what you're describing is the case. I think if you double-check that, you'll find a contact record is being created, otherwise Sagepay would also complain about the lack of a first name, surname, email address too. This is queried from the contact record along with the address, then passed to SP - so I think you would see further errors about those if there was no contact record being created.

What I think is occurring instead is the location type of the address fields is not set to 'Home'. This seems to be something you need to do at the moment to allow Civi to 'find' the address info, although like I said, this is potentially something we can look at doing differently if it's a problem.

So, under Location Types (wherever that is these days ..), can you check the location type 'Home' is present and enabled?

And on the profile that collects the data (that's usually Name & Address unless you've configured a custom one), can you check the address fields on that are set to location type 'Home'?

Alternatively, of course, it might be something else - or you might say, "ah, but using location type 'Home' causes me a huge problem actually" ... in which case we can look at this some more.

But that's what I think the problem is anyway,

Hope that helps!

Andy
Andrew Walker, Developer at Circle Interactive

iammikek

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 4.07
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5
Re: UK payment processors
April 17, 2012, 07:23:12 am
Hi Andy,
Thats done the trick for us too.

Much appreciated
mike

Pages: 1 ... 4 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.