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) »
  • contribution_type_id not getting set with PayPal IPN
Pages: [1]

Author Topic: contribution_type_id not getting set with PayPal IPN  (Read 2083 times)

nkinkade

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 5
contribution_type_id not getting set with PayPal IPN
August 22, 2008, 04:51:18 pm
Recurring contribution payments that are auto-entered via PayPal IPN are not showing up in contribution searches or anywhere else, even though apparently all of the data is there and notes in CiviCRM.log indicate it was a success.

I discovered that for some reason the field contribution_type_id was not getting set and so you'd never see the contribution in the web interface, even though all of the data was in the database.  I manually set the contribution_type_id for the contribution in question and everything worked as expected.  I'm not 100% sure, but it seems like the problem might be near line #233 in PayPalIPN.php:

Code: [Select]
233 // get the contribution, contact and contributionType ids from the GET params
234 $ids['contact']           = self::retrieve( 'contactID'         , 'Integer', 'GET' , true  );
235 $ids['contribution']      = self::retrieve( 'contributionID'    , 'Integer', 'GET' , true  );

The comment says that it's setting contribution, contact, and contributionType, yet it only seems to be setting contribution and contact.

Might this be a bug?

Thanks,

Nathan

nkinkade

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 5
Re: contribution_type_id not getting set with PayPal IPN
August 22, 2008, 05:40:32 pm
http://issues.civicrm.org/jira/browse/CRM-3440

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: contribution_type_id not getting set with PayPal IPN
August 22, 2008, 07:09:20 pm

hey nathan:

can you apply the below diff to your install and check, note that the patch is for v2.1, but should apply quite easily to v2.0

Code: [Select]
Index: CRM/Core/Payment/PayPalIPN.php
===================================================================
--- CRM/Core/Payment/PayPalIPN.php      (revision 16798)
+++ CRM/Core/Payment/PayPalIPN.php      (working copy)
@@ -147,7 +147,9 @@
             // create a contribution and then get it processed
             $contribution =& new CRM_Contribute_DAO_Contribution( );
             $contribution->contact_id = $ids['contact'];
-            $contribution->contribution_type_id  = $contributionType->id;
+            $contribution->contribution_type_id  = CRM_Core_DAO::getFieldValue( 'CRM_Contribute_DAO_ContributionPage',
+                                                                                $ids['contributionPage'],
+                                                                                'contribution_type_id' );
             $contribution->contribution_page_id  = $ids['contributionPage'];
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nkinkade

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 5
Re: contribution_type_id not getting set with PayPal IPN
August 25, 2008, 11:28:55 am
Okay, I have applied this patch.  We haven't received a recurring payment since the change was made, but I'll let you know.  Is the difference between this change and the one I suggested simply that it's probably better to rely on the contribution_type_id in the database rather than the one passed in the GET request from the IPN?

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: contribution_type_id not getting set with PayPal IPN
August 25, 2008, 12:01:43 pm

In recent release we do not send the contribution type. we've been sending the contributiuon page and using that to retrieve the contribution type. i'm not sure what we were sending in 1.7

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

Sunil

  • I post frequently
  • ***
  • Posts: 131
  • Karma: 23
  • The community around a product more important than the product itself?
    • CiviCRM
Re: contribution_type_id not getting set with PayPal IPN
September 05, 2008, 04:25:35 am
in v2.1 GET fields are
Sep 03 17:32:15  [info] $GET = Array
(
    [reset] => 1
    [contactID] => 102
    [contributionID] => 1
    [module] => contribute
    [contributionRecurID] => 1
    [contributionPageID] => 1
)

and we tested the recurring contribution, contribution_type_id set properly.
The community around a product more important than the product itself?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • contribution_type_id not getting set with PayPal IPN

This forum was archived on 2017-11-26.