Given the following URL (working, try it!)
https://select-test.wp3.rbsworldpay.com/wcc/purchase?instId=151711&cartId=28524¤cy=GBP&am
Try to replace the \n with %0A just like you have spaces replaced with %20.
\n
%0A
%20