PayPal Express Checkout fails on events
- Set up PayPal Pro.
- Create a paid event using PayPal Pro as the payment processor.
- Attempt to pay via PayPal.
- Payment goes through.
Your browser session has expired and we are unable to complete your form submission. We have returned you to the initial step so you can complete and resubmit the form. If you experience continued difficulties, please contact us for assistance.
CRM_Event_Form_Registration_Register->postProcess() has these lines:
$params['component'] = 'event'; // This code is duplicated multiple places and should be consolidated. $params = $this->prepareParamsForPaymentProcessor($params); $this->handlePreApproval($params);
CRM_Core_Form::handlePreApproval() has this line:
$params['component'] = 'contribute';
As a result, the
$params['component'] is ALWAYS treated as
contribute, which causes Civi to send the wrong URL to PayPal as the "success URL". so you're redirected back to
civicrm/contribute/transact instead of
I have a solution, but I don't have any idea how one tests this. You would need to mock up the PayPal API. Also, this amazingly seems to have been a problem back to 4.7alpha1.