Details
Description
This patch changes the landing page for failed event registration credit card payments to be the Confirm Event Registration Page
civicrm/event/confirm&reset=1&cc=fail&participantId=
This gives the participant the opportunity to confirm or cancel the transaction. The 'cc=fail' in the URL just changes the message to advise the credit card transaction fails. This is the same URL as is available from the contact dashboard so it gives more consistancy.
Also, have fixed up references to the qfkey as spotted by Elliott.
Outstanding is the issue of endless pending contributions being created but this can be looked at again after the data changes in 3.2. This patch just tidies the payment processor handling up to match the dashboard handling of incomplete registrations
Index: CRM/Core/Payment/PaymentExpressIPN.php
===================================================================
— CRM/Core/Payment/PaymentExpressIPN.php (revision 26715)
+++ CRM/Core/Payment/PaymentExpressIPN.php (working copy)
@@ -399,11 +399,11 @@
if ( $component == "event" ) {
$finalURL = CRM_Utils_System::url( 'civicrm/event/register',
- "_qf_ThankYou_display=1&qfKey={$params['qfKey']}",
+ "_qf_ThankYou_display=1&qfKey=$qfKey",
false, null, false );
} elseif ( $component == "contribute" ) {
$finalURL = CRM_Utils_System::url( 'civicrm/contribute/transact', - "_qf_ThankYou_display=1&qfKey={$params['qfKey']}",
+ "_qf_ThankYou_display=1&qfKey=$qfKey",
false, null, false );
}
@@ -412,12 +412,12 @@
}else {
if ( $component == "event" ) {
- $finalURL = CRM_Utils_System::url( 'civicrm/event/register',
- "_qf_Register_display=1&cancel=1&qfKey={$params['qfKey']}",
+ $finalURL = CRM_Utils_System::url('civicrm/event/confirm',
+ "reset=1&cc=fail&participantId=$privateData[participantID]",
false, null, false );
} elseif ( $component == "contribute" ) {
$finalURL = CRM_Utils_System::url( 'civicrm/contribute/transact', - "_qf_Main_display=1&cancel=1&qfKey={$params['qfKey']}",
+ "_qf_Main_display=1&cancel=1&qfKey=$qfKey",
false, null, false );
}
Index: CRM/Event/Form/Registration/ParticipantConfirm.php
===================================================================
— CRM/Event/Form/Registration/ParticipantConfirm.php (revision 26715)
+++ CRM/Event/Form/Registration/ParticipantConfirm.php (working copy)
@@ -52,7 +52,8 @@
public function preProcess( )
{
$this->_participantId = CRM_Utils_Request::retrieve( 'participantId', 'Positive', $this );
+ // is this a redirection from a failed credit card processing transaction? cc is set by credit card re-direct
+ $this->_cc = CRM_Utils_Request::retrieve( 'cc' , 'String', $this );
//get the contact and event id and assing to session.
$values = array( );
$csContactID = $eventId = null;
@@ -102,11 +103,13 @@
CRM_Core_DAO::commonRetrieve( 'CRM_Event_DAO_Event', $params, $values,
array( 'title' ) );
+
$buttons = array( );
require_once 'CRM/Event/PseudoConstant.php';
// only pending status class family able to confirm.
$statusMsg = null;
+
if ( array_key_exists( $this->_participantStatusId,
CRM_Event_PseudoConstant::participantStatus( null, "class = 'Pending'" ) ) ) {
@@ -127,9 +130,13 @@
'name' => ts('Confirm Registration'),
'spacing' => ' ',
'isDefault' => true )));
+ if ($this->_cc == 'fail')
}
}
+
// status class other than Negative should be able to cancel registration.
if ( array_key_exists( $this->_participantStatusId,
CRM_Event_PseudoConstant::participantStatus( null, "class != 'Negative'" ) ) ) {