Allow processors (inc. paypal rest) to not support cancel recurring #210
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current PayPal Checkout implementation uses reference transactions to deliver recurring payments.
Therefore, no action is needed on the Payment processor side to cancel a recurring transaction.
So I wanted to set CRM_Core_Payment_OmnipayMultiProcessor::supportsCancelRecurring() to return FALSE.
Currently, with it set to TRUE, cancelling a recurring payment is broken for anoymous users. Setting it to FALSE fixes the issue.
I added a meta data field to define this to PayPal Checkout.
I didn't want to add it to other payment processors but since the default for undefined meta data is false, I thought it might be a good idea to be able to default the default when none exists.
To do this, I added another param to ::getProcessorTypeMetadata() to allow it to return other values (TRUE in this case).
I also added a commit to comply with civicrm coding standards. The interesting stuff is in this commit: 11bcd79.
Interested to know what you think about this approach.