drastik / com.drastikbydesign.stripe

CMS Independent Stripe payment processor for CiviCRM 4.x
Other
35 stars 48 forks source link

Recurring contributions not getting recorded in CiviCRM #101

Open Upperholme opened 8 years ago

Upperholme commented 8 years ago

I'm now starting to receive the second round of payments on some monthly recurring contributions. The initial payment went through and was logged in CiviCRM correctly. Stripe reports that the webhooks were successful. But no contribution record is getting created in CiviCRM. In the Civi log I'm seeing the following error:

Sep 14 16:27:02 [info] $Fatal Error Details = Array (
[message] => One of parameters (value: NULL) is not of the type Integer [code] => )

Sep 14 16:27:02 [info] $backTrace = #0 /home/pagen/sites/default/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(364): CRM_Core_Error::backtrace("backTrace", TRUE)

1 /home/pagen/sites/default/wp-content/plugins/civicrm/civicrm/CRM/Utils/Type.php(362): CRM_Core_Error::fatal("One of parameters (value: NULL) is not of the type Integer")

2 /home/pagen/sites/default/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1260): CRM_Utils_Type::validate("NULL", "Integer")

3 /home/pagen/sites/default/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1179): CRM_Core_DAO::composeQuery("INSERT INTO civicrm_contribution (\n contact_id, financial_type_id, ...", (Array:13), TRUE)

4 /home/pagen/sites/default/wp-content/plugins/files/civicrm/extensions/com.drastikbydesign.stripe-4.6-dev/CRM/Stripe/Page/Webhook.php(141): CRM_Core_DAO::executeQuery("INSERT INTO civicrm_contribution (\n contact_id, financial_type_id, ...", (Array:13))

5 /home/pagen/sites/default/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Stripe_Page_Webhook->run((Array:3), NULL)

6 /home/pagen/sites/default/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))

7 /home/pagen/sites/default/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))

8 /home/pagen/sites/default/wp-content/plugins/civicrm/civicrm.php(1189): CRM_Core_Invoke::invoke((Array:3))

9 /home/pagen/sites/default/wp-content/plugins/civicrm/includes/civicrm.basepage.php(134): CiviCRM_For_WordPress->invoke()

10 [internal function](): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))

11 /home/pagen/sites/default/wp-includes/plugin.php(571): call_user_func_array((Array:2), (Array:1))

12 /home/pagen/sites/default/wp-includes/class-wp.php(622): do_action_ref_array("wp", (Array:1))

13 /home/pagen/sites/default/wp-includes/functions.php(877): WP->main("")

14 /home/pagen/sites/default/wp-blog-header.php(14): wp()

15 /home/pagen/sites/default/index.php(17): require("/home/pagen/sites/default/wp-blog-header.php")

16 {main}

Is this linked to issue #92 ?

h-c-c commented 8 years ago

Yes, I believe it is linked to issue 92. I have a workaround. If you're not using campaign IDs, (and desperate to get recurring contributions working) you can modify Webhook.php not to use campaign_id at all. This is working for me...I am getting contributions recorded through Webhook.php. So for each database INSERT, remove campaign_id and %13.

Caveat: This may be unrelated, but I have found that while the contribution records are getting created, they aren't updating my membership end-dates and statuses, the way that the contribution page does.

FWIW, I also can't update my membership statuses/end-dates when I create a contribution for membership with the api.

Upperholme commented 8 years ago

Any news on this issue, or is the workaround proposed here by h-c-c (for which many thanks) still the only viable approach?