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
Branches
Tags
1 merge request!176Release 6.7
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment