On a PC:
1) Go to http://www.sonyentertainmentnetwork.com and log in to your account
2) Select Redeem Prepaid Card and enter your code

On your PlayStation®4:
- Select [Account Management] -> [Redeem Codes]

That should help with downloading the game to your playstation 4 console.

I can't help you with linking your sony network account to your Square-Enix account, I am afraid for that you need to contact support...