-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CIWEMB-249: Add hook to allow other extensions to opt for Membershipextras support #462
CIWEMB-249: Add hook to allow other extensions to opt for Membershipextras support #462
Conversation
This adds the settings mixin to the info file, which is required to load the settings from the settings folder after upgrading the civix file to version v22.05.2
…r to 'supported' As prepartion to support other payment processors that does not implement the Payment_Manual core class, I am changing the occurrences of the word 'Manual' payment processor (and 'Offline' in some places) to 'Supported' for better clarity.
$supportedPaymentProcessors = self::getManualPaymentProcessors(); | ||
|
||
// Allow extensions to opt in for Membershipextras | ||
// Support. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why we need two lines here in the inline comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update @erawat , I also pushed two new commits to fix some issues with the tests, given I discovered that the previous time the action ran them they failed despite reporting them as passed,.
aaabccb
to
a2d1b2d
Compare
Overview
Membershipextras only supports payment processors that implement the Payment_Manual class, but given we now want it to work with GoCardless as well, and in the future we will probably add Stripe support too, this approach has to change. Here we we new hook that allows such extensions to opt for Membershipextras support.
Before
Membershipextras extension only work with Payment Processors that:
class_name
field =Payment_Manual
After
This extension stills supports the same conditions mentioned in the "Before" section, it also allows other payment processor extensions to add themselves to get Membershipextras support.
Technical Details
The new hook is called:
hook_membershipextras_updateSupportedPaymentProcessors
an passes the list of payment processors Membershipextras support by reference$supportedPaymentProcessor
, which allows other extension to update the list. Here is a sample implementation inside an test extension called "testextension", which adds a payment processor defined inside it called "My new Test Payment Processor" to the list of Membershipextras supported processors:Other notes