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

Resolve extensions/stripe#16. Missing contact ID for anonymous event registration

parent d272c178
Branches
Tags
1 merge request!13Resolve extensions/stripe#16. Missing contact ID for anonymous event registration
......@@ -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: https://lab.civicrm.org/extensions/stripe/issues/16
// 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);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment