In ipn.php you replaced http_build_query(). Why not to do the same in here ?