- if ($action == 'cancel') {
- $url = 'civicrm/contribute/unsubscribe';
- }
- elseif ($action == 'billing') {
- //in notify mode don't return the update billing url
- if ($this->_paymentProcessor['billing_mode'] == self::BILLING_MODE_NOTIFY) {
- return NULL;
- }
- $url = 'civicrm/contribute/updatebilling';
- }
- elseif ($action == 'update') {
- $url = 'civicrm/contribute/updaterecur';
- }
- $session = CRM_Core_Session::singleton();
- $userId = $session->get('userID');
- $checksumValue = "";
-
- if ($entityID && $entity == 'membership') {
- if (!$userId) {
- $contactID = CRM_Core_DAO::getFieldValue("CRM_Member_DAO_Membership", $entityID, "contact_id");
- $checksumValue = CRM_Contact_BAO_Contact_Utils::generateChecksum($contactID, NULL, 'inf');
- $checksumValue = "&cs={$checksumValue}";
- }
- return CRM_Utils_System::url($url, "reset=1&mid={$entityID}{$checksumValue}", TRUE, NULL, FALSE, TRUE);
- }
+ // Set URL
+ switch ($action) {
+ case 'cancel' :
+ $url = 'civicrm/contribute/unsubscribe';
+ break;
+
+ case 'billing' :
+ //in notify mode don't return the update billing url
+ if ($this->_paymentProcessor['billing_mode'] == self::BILLING_MODE_NOTIFY) {
+ return NULL;
+ }
+ $url = 'civicrm/contribute/updatebilling';
+ break;