Skip to content

Fixed redirect issue on Event registration #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion CRM/Core/Payment/OmnipayMultiProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,20 @@ public static function processPaymentResponse($params) {
* @param null|object $response
*/
protected function redirectOrExit($outcome, $response = NULL) {
// Session is reset for event registration for unknown reason.
// set the component so that the url is build correctly.
if (!empty($this->transaction_id)) {
$participantCount = civicrm_api3('ParticipantPayment', 'getcount', [
'contribution_id' => $this->transaction_id,
]);
if ($participantCount) {
$this->_component = 'event';
}
else {
$this->_component = 'contribute';
}
}

switch ($outcome) {
case 'fail':
$userMsg = ts('Your payment was not successful. Please try again');
Expand Down Expand Up @@ -1324,4 +1338,3 @@ public function getResponseBodies() {
}

}