Skip to content

Commit

Permalink
Fixed redirect issue on Event registration
Browse files Browse the repository at this point in the history
  • Loading branch information
pradpnayak authored and mattwire committed Nov 2, 2018
1 parent c45706f commit b27c827
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion CRM/Core/Payment/OmnipayMultiProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,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 @@ -1312,4 +1326,3 @@ public function getResponseBodies() {
}

}

0 comments on commit b27c827

Please sign in to comment.