Commit cfaee558 authored by mattwire's avatar mattwire

Resolve #16. Missing contact ID for anonymous event registration

parent d272c178
......@@ -919,11 +919,21 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
* @return int ContactID
protected static function getContactId($params) {
return CRM_Utils_Array::value('contactID', $params,
$contactId = CRM_Utils_Array::value('contactID', $params,
CRM_Utils_Array::value('contact_id', $params,
CRM_Utils_Array::value('cms_contactID', $params,
CRM_Utils_Array::value('cid', $params, NULL
if (!empty($contactId)) {
return $contactId;
// FIXME: Ref:
// The problem is that when registering for a paid event, civicrm does not pass in the
// contact id to the payment processor (civicrm version 5.3). So, I had to patch your
// getContactId to check the session for a contact id. It's a hack and probably should be fixed in core.
// The code below is exactly what CiviEvent does, but does not pass it through to the next function.
$session = CRM_Core_Session::singleton();
return $session->get('transaction.userID', NULL);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment