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
PayPal_Gateway extends Payment_Gateway
PayPalDirect_Gateway extends PayPal_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_*
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.
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.
Cheers Will, good to know. We'll start looking into namespaces soon.