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

Fix message='null' on successful processing of webhook

parent 82b1eaf3
No related branches found
No related tags found
1 merge request!176Release 6.7
...@@ -333,13 +333,17 @@ class CRM_Core_Payment_StripeIPN { ...@@ -333,13 +333,17 @@ class CRM_Core_Payment_StripeIPN {
} }
// Record that we have processed this webhook (success or error) // Record that we have processed this webhook (success or error)
PaymentprocessorWebhook::update(FALSE) $paymentProcessorWebhookUpdate = PaymentprocessorWebhook::update(FALSE)
->addWhere('event_id', '=', $this->getEventID()) ->addWhere('event_id', '=', $this->getEventID())
->addWhere('trigger', '=', $this->getEventType()) ->addWhere('trigger', '=', $this->getEventType())
->addValue('status', $return->ok ? 'success' : 'error') ->addValue('status', $return->ok ? 'success' : 'error')
->addValue('message', preg_replace('/^(.{250}).*/su', '$1 ...', $return->message)) ->addValue('processed_date', 'now');
->addValue('processed_date', 'now')
->execute(); // Only add message if not empty
if (!empty($return->message)) {
$paymentProcessorWebhookUpdate->addValue('message', preg_replace('/^(.{250}).*/su', '$1 ...', $return->message));
}
$paymentProcessorWebhookUpdate->execute();
return $return; return $return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment