The main thing to determine is exactly what your payment provider needs to do when it pings your site. Typically they're just sending payment notifications that you should then validate and process, resulting in payment transactions being created for your orders. This shouldn't have to depend on the checkout URLs at all.
In the PayPal module, I use a separate "IPN listener" menu item that is always accessible (and therefore session independent). PayPal gives you several ways to validate an IPN is legitimate before processing it, so make sure you don't skip this step for your gateway.
To process the transaction, you're going to need the payment method instance that was selected during checkout to submit payment. I get this in the PayPal module by including the instance ID in the IPN URL that PayPal POSTs its data to. If you can't do that for some reason, then you can load the order and find the selected payment method instance in the $order->data array.
Comments
see below!