Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-2855

subscription cancellation URLs are difficult to generalise for new payment gateways

    Details

    • Type: Patch
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Labels:
      None

      Description

      Currently the URLs for subscription cancellation are determined by a static method in class CRM_Contribute_Form_ContributionBase . This static function examines the supplied payment processor and on that basis determines a URL. This seems somewhat at odds with the general modular OO design of the payment modules, and AFAICT means that every time a new recurring payment module is added, a patch to the core civiContribute module will be required.

      The attached patch set preserves the existing method for PayPal and authorize.net, but adds a new method cancelSubscriptionURL() to the CRM_Core_Payment class (returning null) allowing subclasses to override if necessary to return a different value. It also adds the appropriate code to the cancelSubscriptionUrl() method to call this method on an isntance of the class which implements the payment processor.

      It would of course be very simple to modify the PayPal and authorize.net classes to operate in the same way, removing the need for special-casing in CRM_Contribute_Form_ContributionBase, but I thought I'd keep the patch as light as possible until an admin suggested I do otherwise. I'd be happy to provide these patches as well if necessary though.

        Attachments

          Activity

            People

            • Assignee:
              sunil Sunil Pawar
              Reporter:
              admackin Andy MacKinlay
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 20 minutes
                20m
                Remaining:
                Remaining Estimate - 20 minutes
                20m
                Logged:
                Time Spent - Not Specified
                Not Specified