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) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Paypal Express payments not recording in Civi
Pages: [1]

Author Topic: Paypal Express payments not recording in Civi  (Read 1393 times)

Eliet Henderson

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 4
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 7
  • MySQL version: 5.0
  • PHP version: 5.2
Paypal Express payments not recording in Civi
April 03, 2013, 12:49:54 pm
Hi, I use Paypal Pro, which offers Paypal Express checkout for the donor to log into his/her Paypal account and pay from there. This has worked fine in the past. I recently upgraded from Civi 3.8 to 4.2, and now payments made using Paypal Express (whether one-time or recurring) are processed correctly in Paypal but are not recorded in Civi. Other payments made using Paypal Pro (using a credit card on our site) record correctly in Paypal and in Civi.

Has anyone else experienced this? Any suggestions for how to find the problem? Thanks.

Update: I reviewed the IPN history in our Paypal account -- all transactions show the IPN status as "Sent" with no errors or retries, for both Website Payments Pro and Express Checkout.
« Last Edit: April 03, 2013, 01:17:46 pm by Eliet Henderson »

theitd

  • I’m new here
  • *
  • Posts: 22
  • Karma: 1
    • the ITD
  • CiviCRM version: 3.4.7
  • CMS version: 1.15.26
  • MySQL version: 5.1.66
  • PHP version: 5.3
Re: Paypal Express payments not recording in Civi
April 10, 2013, 04:18:30 am
Hi Eliet,

I think we have the same problem. I'm running Civi 3.4.7 on Joomla 1.5.
Can you post the 'Merchant reference ID' from a recurring payment that failed? This can be found in the Profile Details page on Paypal.
It should look something like this (taken from a recurring card payment):

i=1c7cc06ef652fb91820e0ad4539xxxxx&m=contribute&c=1&r=73&b=6164&p=1

I think the issue is that Paypal Express only sets the 'i' parameter, so the above example looks like this (taken from an Express Checkout payment):

i=1c7cc06ef652fb91820e0ad4539abb0b&m=&c=&r=&b=&p=1

When the IPN posts to Civi, it gets rejected claiming there's 'No Module Parameter Found'. In other words, it doesn't know if the callback refers to a contribution or an event. This is set by the m= parameter.
Even if you force Civi to default to contribution - it still fails, as there is way to match to a donor ID (c=<donor_id>).

Would you confirm that it's the same issue by checking a Merchant ID from a failed payment? Then maybe we can get advice on whether to change the PayPal Express form, or the PayPal IPN that's supposed to do the matching.
Too err is human, to really foul things up needs a computer.

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: Paypal Express payments not recording in Civi
April 10, 2013, 08:37:04 am

hmm, i dont know if we ever added / upgraded the code for paypal express to handle recurring.

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

theitd

  • I’m new here
  • *
  • Posts: 22
  • Karma: 1
    • the ITD
  • CiviCRM version: 3.4.7
  • CMS version: 1.15.26
  • MySQL version: 5.1.66
  • PHP version: 5.3
Re: Paypal Express payments not recording in Civi
April 10, 2013, 04:04:45 pm
Thanks for the reply, Lobo.

I've had a go at making the changes myself. I'm no expert - so there may be gaping flaws in the rewrites.
The altered files are attached and could be copied over the following files (renamed to xxx.php):

/<joomla_root>/administrator/components/com_civicrm/civicrm/extern/ipn.php
/<joomla_root>/administrator/components/com_civicrm/civicrm/CRM/Core/Payment/PayPalProIPN.php

Basically, the ipn.php file checks for the presence of an invoice_id and (combined with the absence of a module, assumes a contribution) - this in turn is used to compare against the original recurring payment. From that, PayPalProIPN.php retrieves the other details (such as contact_ID, recurring_payment_ID etc....)

I've tested it using the sandbox and live - and left a fair bit of logging in to check it's working okay.
Any suggestions for code improvements would be very welcome!
Too err is human, to really foul things up needs a computer.

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: Paypal Express payments not recording in Civi
April 10, 2013, 04:58:53 pm

hey theitd:

can u post the diffs rather than the entire file

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

theitd

  • I’m new here
  • *
  • Posts: 22
  • Karma: 1
    • the ITD
  • CiviCRM version: 3.4.7
  • CMS version: 1.15.26
  • MySQL version: 5.1.66
  • PHP version: 5.3
Re: Paypal Express payments not recording in Civi
April 11, 2013, 01:02:23 am
Here they are. I had copied the originals to .bak - so I hope this is right....
Too err is human, to really foul things up needs a computer.

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Paypal Express payments not recording in Civi
April 11, 2013, 05:05:37 am
We tried doing a test one-time and recurring payment for paypal express in v4.3, and v4.2.

One time payment seems to work without any problems.

For recurring first immediate transaction gets completed but others i think fail due to incorrect i parameter as mentioned by Ben.

Its right that paypal express hasn't been tested / upgraded for recurring option.

Ben,
i think right direction would be to investigate why 'profilereference' (value of i=..) doesn't have values for 'm' or 'c' .. Probably profile is not being created in a right way during paypal express ? Agree that from invoice_id rest of the values can be computed, but if paypal-pro IPN also require values for 'm', 'c' (and other params), paypal express should also work the same way to make things consistent.
Could you investigate in that direction ?
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

theitd

  • I’m new here
  • *
  • Posts: 22
  • Karma: 1
    • the ITD
  • CiviCRM version: 3.4.7
  • CMS version: 1.15.26
  • MySQL version: 5.1.66
  • PHP version: 5.3
Re: Paypal Express payments not recording in Civi
April 11, 2013, 03:13:02 pm
Hi Deepak,

Sure, I'll take a look and give it a go.
The method of using the invoiceID means, for us, that historical subscriptions will keep working.

But I've found the file ../Payment/PayPalImpl.php which I think is the right one.
I'll let you know how it goes!
Too err is human, to really foul things up needs a computer.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Paypal Express payments not recording in Civi
July 28, 2013, 06:15:21 pm
We are hitting this too - it seems the contributions are not created until after there is a success - so on the current flow it's not possible to pass the currently-expected parameters (contribution_id, contribution_recur_id etc) to the paypal express call
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

theitd

  • I’m new here
  • *
  • Posts: 22
  • Karma: 1
    • the ITD
  • CiviCRM version: 3.4.7
  • CMS version: 1.15.26
  • MySQL version: 5.1.66
  • PHP version: 5.3
Re: Paypal Express payments not recording in Civi
July 29, 2013, 01:59:05 am
Hi Eileen,

I think you're right.  And changing the workflow wouldn't address the problem for historic donations - which can go on for years!

Finding another way of linking the recurring donations to the donor record was of more use to us, using the method explained in my second post.  However, this has had the frustrating side effect of creating duplicate donation records for new sign-ups - as the workaround doesn't distinguish between a 'recurring_payment_profile_created' and 'recurring_payment' transaction type.

I'm looking into ways of marking the 'recurring_payment_profile_created' type as 'pending'. This is then completed with the correct amounts (ie. fee, net & total) and transaction ID when the second IPN callback occurs (usually a minute or two later from PayPal).

I've tried several code changes to the 'recur' function - but have not had much luck so far. If anyone has any pointers, it would be much appreciated!
Too err is human, to really foul things up needs a computer.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Paypal Express payments not recording in Civi
July 29, 2013, 02:32:50 am
Due to the historical issue I'm working on a fairly hacky fix that will accept the payment express payments without all the extra data - will post back!
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Paypal Express payments not recording in Civi
July 30, 2013, 07:05:09 pm
I have updated the ticket with what we are using

http://issues.civicrm.org/jira/browse/CRM-12679#comment-52205

I have this working of 4.2-d7 (git@github.com:fuzionnz/civicrm.git)

the above gives detailed information of what bits have been submitted to which versions of core - but the bit that actually makes it work has not been submitted & I have no immediate plans (funding) to do that
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Paypal Express payments not recording in Civi

This forum was archived on 2017-11-26.