Development - Custom Payment Gateway
Which payment gateway are you wanting to develop?  If it is one supported by Omnipay then take a look at the Omnipay Multiprocessor Extension

If you are considering any work in this area I'd strongly encourage you to discuss this in the ~dev-financial channel on CiviChat

As regards Settings - there are significant changes coming up in 5.8 as described by Eileen here