I now wanted to get the order id which it has just been placed to know it before sending it to the Payment Gateway

I am developing a Magento2 Payment Gateway
I have created a controller named Index in Controller/Redirect directory

I now wanted to get the order id which it has just been placed to know it before sending it to the Payment Gateway

How is it possible?

THanks

How to get the last order programmatically?

How to use it in my custom controller?
it is reffering to $this which in the current controller it has not been instantiated the $checkoutSession