diff --git a/CRM/Core/Payment/StripeIPN.php b/CRM/Core/Payment/StripeIPN.php index 41fecef8cdaa3aa636f3066ab9a9d1ca1407ae60..2e09f2e3c70e00aaf016af65b6ae25603fb5a013 100644 --- a/CRM/Core/Payment/StripeIPN.php +++ b/CRM/Core/Payment/StripeIPN.php @@ -46,11 +46,9 @@ class CRM_Core_Payment_StripeIPN { protected $customer_id = NULL; protected $charge_id = NULL; protected $previous_plan_id = NULL; - protected $plan_id = NULL; protected $plan_amount = NULL; protected $frequency_interval = NULL; protected $frequency_unit = NULL; - protected $plan_name = NULL; protected $plan_start = NULL; /** @@ -356,7 +354,7 @@ class CRM_Core_Payment_StripeIPN { return TRUE; case 'customer.subscription.updated': - if (!$this->setInfo()) { + if (!$this->getSubscriptionDetails()) { return TRUE; } if (empty($this->previous_plan_id)) { @@ -430,16 +428,9 @@ class CRM_Core_Payment_StripeIPN { return FALSE; } - $this->previous_plan_id = CRM_Stripe_Api::getParam('previous_plan_id', $this->_inputParameters); $this->invoice_id = $this->retrieve('invoice_id', 'String', FALSE); $this->receive_date = $this->retrieve('receive_date', 'String', FALSE); $this->charge_id = $this->retrieve('charge_id', 'String', FALSE); - $this->plan_id = $this->retrieve('plan_id', 'String', FALSE); - $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); - $this->plan_name = $this->retrieve('plan_name', 'String', FALSE); - $this->plan_start = $this->retrieve('plan_start', 'String', FALSE); $this->amount = $this->retrieve('amount', 'String', FALSE); if (($this->_inputParameters->data->object->object !== 'charge') && ($this->charge_id !== NULL)) { @@ -481,6 +472,11 @@ 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); + $this->plan_start = $this->retrieve('plan_start', 'String', FALSE); return TRUE; } diff --git a/CRM/Stripe/Api.php b/CRM/Stripe/Api.php index ccd6429ce11ff89ea771cfd194e1471349e66be5..fb2155345cc863daa241e40b3cdfb22e4aac8316 100644 --- a/CRM/Stripe/Api.php +++ b/CRM/Stripe/Api.php @@ -115,12 +115,6 @@ class CRM_Stripe_Api { case 'currency': return (string) mb_strtoupper($stripeObject->plan->currency); - case 'plan_id': - return (string) $stripeObject->plan->id; - - case 'plan_name': - return (string) $stripeObject->plan->name; - case 'plan_start': return self::formatDate($stripeObject->start_date); diff --git a/docs/releasenotes.md b/docs/releasenotes.md index 7b745b1690a25d95c68a309673df6bbe04dc9bc4..af7d06f0933a61575016b46d6f8a3efd0f5a7c83 100644 --- a/docs/releasenotes.md +++ b/docs/releasenotes.md @@ -13,7 +13,7 @@ Releases use the following numbering system: * Fix [#258](https://lab.civicrm.org/extensions/stripe/-/issues/258) Credit card element doesn't load in "Submit credit card contribution" popup form on backend. * Fix [#262](https://lab.civicrm.org/extensions/stripe/-/issues/262) Fix `customer.subscription.deleted` webhook event not working (500 internal server error). - +* Fix [#270](https://lab.civicrm.org/extensions/stripe/-/issues/270) Fix 500 Internal Server error for the customer.subscription.updated event ## Release 6.5.2 * [!129](https://lab.civicrm.org/extensions/stripe/-/merge_requests/129) Don't check inactive membership blocks for separate payment setting.