Zend certified PHP/Magento developer

Creating custom redirect payment method?

I’ve been having trouble finding documentation to implement a custom payment method. The flow needs to be like this:

  1. User selects [custom payment method] on the checkout page.
  2. Order is placed.
  3. afterOrderPlaced should check if [custom payment method] was used and make a request to an external API with order code and credentials(From config page. This is ready)
  4. Get back an order code as response, append it to a URL from config and redirect user to the payment provider’s page.
  5. Complete payment there and get redirected back to a URL along with the orderCode as param.
  6. In said URL we get the orderCode, mark the order as payment complete or similar(This step is ready)
  7. Go to thank you page.

I mostly haven’t been able how to implement the frontend part of the payment method. I have looked through the posts in here and nothing is helping.

Additionally I’ve been reading these:

and all of these are out of date and/or deprecated on top of just being written like guides of the “do this and that” style which don’t help. I don’t want to have any front-end forms or validation or whatever they tell me to, in the checkout. That’s all gonna be handled by the payment provider.

Is there any resource I can actually read that isn’t “the source code” of how to implement a payment method and more importantly what each file’s purpose is? For example why do we have these 2 files with the same name and the documentation just tells me to add them? What is each file’s purpose and what can I modify in there? Where are there reference?