diff --git a/CRM/Core/Payment/StripeIPN.php b/CRM/Core/Payment/StripeIPN.php index 68de92a2915a34fb52f59ff469008f6e280efcdd..5c0d943bb57eb44897230b2ba803f28c07b7b55a 100644 --- a/CRM/Core/Payment/StripeIPN.php +++ b/CRM/Core/Payment/StripeIPN.php @@ -333,13 +333,17 @@ class CRM_Core_Payment_StripeIPN { } // Record that we have processed this webhook (success or error) - PaymentprocessorWebhook::update(FALSE) + $paymentProcessorWebhookUpdate = PaymentprocessorWebhook::update(FALSE) ->addWhere('event_id', '=', $this->getEventID()) ->addWhere('trigger', '=', $this->getEventType()) ->addValue('status', $return->ok ? 'success' : 'error') - ->addValue('message', preg_replace('/^(.{250}).*/su', '$1 ...', $return->message)) - ->addValue('processed_date', 'now') - ->execute(); + ->addValue('processed_date', 'now'); + + // Only add message if not empty + if (!empty($return->message)) { + $paymentProcessorWebhookUpdate->addValue('message', preg_replace('/^(.{250}).*/su', '$1 ...', $return->message)); + } + $paymentProcessorWebhookUpdate->execute(); return $return; }