Which class we need to extends,implement interface and method use when create a custom payment gateway.
Check magento sample module for payment gateway
For more detail check magento devdocs
Most important part is Facade Configuration. Check from here: https://devdocs.magento.com/guides/v2.3/payments-integrations/base-integration/facade-configuration.html
OxiPay module is developed using payment gateway. and this is simple module. https://github.com/oxipay/oxipay-magento-2.x