This a a very shadowy area of PHP security - how to persist the session without exposing a cookie or session id in the url? Unfortunately, the only somewhat safe solution happens to be with a cookie but I'll try and explain a way to make it as safe as possible.
Before the user goes off-site you need to prepare your database to accept them back without needing to provide login details again - create two columns in your user table - "key" and "timeout".
Now, as a user prepares to leave the site through your payment gateway, you need to update their record in the database - generate a unique key to store.
$key = md5(uniqid(rand(), true));
Store this in the datebase along with a timeout (say, an hour or two, or even a whole day - whatever you need). So long as they return within the specified timeframe and can produce the proper key the system will continue to recognize the user and you don't have to worry about logging in again.
Now we need to set a cookie with the same key and, say, a salted md5 hash of their username (just in case). Make sure to give it the same timeout that you gave their record in the database (you don't want old cookies with sensitive information lying around forever).
Once they've returned to the site grab the cookie with the unique ID and their hashed username and compare it to the key/timeout combination in your database. If they match, all is well. Then delete the cookie.