You almost had it.
In the $payload
you need to set the default redirection param to 0/false, $payload['redirection'] = false;
The location header is empty because it followed through. Then you will be able to get the redirection URL from the Location header. You can see the list of arguments used here