You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should discuss naming conventions a little bit and aim to have them tidied up for mid term. At the moment we have things like:
Payment_Gateway living in Gateway.php
then
PayPal_Gateway extends Payment_Gateway
and
PayPalDirect_Gateway extends PayPal_Gateway
PayPalExpress_Gateway "
I think it would be best to try and stick to the convention of filename being the prefix for the class names in that file e.g:
PaymentGateway.php has classes PaymentGateway_*
PayPal.php has classes PayPal_*
etc.
I'm also happy to reconsider naming Payment_Controller to PaymentProcessor and for consistency maybe we should have
Payment.php -> Payment
PaymentGateway.php -> PaymentGateway
PaymentProcessor.php -> PaymentProcessor
And perhaps adding another class to encapsulate the model/controller/gateway instantiation instead of using a static factory method like:
PaymentFactory.php -> PaymentFactory
Which could take care of retrieving supported payment methods and creating the payment controller with model and gateway injected.
The text was updated successfully, but these errors were encountered:
If you're thinking about making payment support 3.0 only I'd also suggest looking into PHP namespaces. We haven't made much use of them in core yet but 3.1 will use them.
We should discuss naming conventions a little bit and aim to have them tidied up for mid term. At the moment we have things like:
Payment_Gateway living in Gateway.php
then
PayPal_Gateway extends Payment_Gateway
and
PayPalDirect_Gateway extends PayPal_Gateway
PayPalExpress_Gateway "
DummyGatewayHosted_Gateway extends Payment_Gateway
DummyMerchantHosted_Gateway extends Payment_Gateway
I think it would be best to try and stick to the convention of filename being the prefix for the class names in that file e.g:
PaymentGateway.php has classes PaymentGateway_*
PayPal.php has classes PayPal_*
etc.
I'm also happy to reconsider naming Payment_Controller to PaymentProcessor and for consistency maybe we should have
Payment.php -> Payment
PaymentGateway.php -> PaymentGateway
PaymentProcessor.php -> PaymentProcessor
And perhaps adding another class to encapsulate the model/controller/gateway instantiation instead of using a static factory method like:
PaymentFactory.php -> PaymentFactory
Which could take care of retrieving supported payment methods and creating the payment controller with model and gateway injected.
The text was updated successfully, but these errors were encountered: