Skip to content
Snippets Groups Projects
Commit 2035951a authored by mattwire's avatar mattwire
Browse files

Remove handling for webhooks - they were not working and could lead to broken...

Remove handling for  webhooks - they were not working and could lead to broken recurring contributions
parent 52c36970
Branches
Tags
No related merge requests found
......@@ -362,24 +362,7 @@ class CRM_Core_Payment_StripeIPN {
return TRUE;
case 'customer.subscription.updated':
if (!$this->getSubscriptionDetails()) {
// Not matched with an existing subscription in CiviCRM
return TRUE;
}
if (empty($this->previous_plan_id)) {
// Not a plan change...don't care.
return TRUE;
}
// The Stripe "plan" has been changed. Update the following information within CiviCRM:
// Amount, frequency_unit, frequency_interval
civicrm_api3('ContributionRecur', 'create', [
'id' => $this->contribution_recur_id,
'amount' => $this->plan_amount,
'auto_renew' => 1,
'frequency_unit' => $this->frequency_unit,
'frequency_interval' => $this->frequency_interval,
]);
// Subscription is updated. This used to be "implemented" but didn't work
return TRUE;
case 'customer.subscription.deleted':
......@@ -483,7 +466,6 @@ class CRM_Core_Payment_StripeIPN {
}
return FALSE;
}
$this->previous_plan_id = CRM_Stripe_Api::getParam('previous_plan_id', $this->_inputParameters);
$this->plan_amount = $this->retrieve('plan_amount', 'String', FALSE);
$this->frequency_interval = $this->retrieve('frequency_interval', 'String', FALSE);
$this->frequency_unit = $this->retrieve('frequency_unit', 'String', FALSE);
......
......@@ -182,12 +182,6 @@ class CRM_Stripe_Api {
case 'id':
return (string) $stripeObject->id;
case 'previous_plan_id':
if (preg_match('/\.updated$/', $stripeObject->type)) {
return (string) $stripeObject->data->previous_attributes->plan->id;
}
break;
}
return NULL;
}
......
......@@ -11,7 +11,7 @@ Releases use the following numbering system:
## Release 6.5.7 (not yet released 2021-01-23)
* Don't change 'created_date' when subscription is updated.
* Remove handling for `customer.subscription.updated` webhooks - they were not working and could lead to broken recurring contributions.
* Rename ProcessStripe job to "Stripe: Cleanup".
## Release 6.5.6
......
......@@ -15,7 +15,7 @@
<author>Matthew Wire (MJW Consulting)</author>
<email>mjw@mjwconsult.co.uk</email>
</maintainer>
<releaseDate>2021-01-23</releaseDate>
<releaseDate>2021-02-07</releaseDate>
<version>6.5.7-dev</version>
<develStage>beta</develStage>
<compatibility>
......
......@@ -10,7 +10,7 @@
*/
require_once 'stripe.civix.php';
require_once __DIR__.'/vendor/autoload.php';
require_once __DIR__ . '/vendor/autoload.php';
use CRM_Stripe_ExtensionUtil as E;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment