I would avoid it!
Use a payment provider.
e.g.
www.bitcoin247.comThey charge very little (there are others that are free).
You just make 2 http requests to send coins. Also to receive coins make one http request to get the address. Display this to user - the user pays that address - and bitcoin247 call you back on a specific URL when the coins are received. If you like in the callback handler you can automatically forward the coins to your offline wallet so if bitcoin247 go bust you only lose what is "in flight".
We use them for
https://bitcoinvanity.appspot.com.
Works perfectly. Only issue I have is that they only call back after 6 confirmations. I would like to get a callback as soon as they get the transaction and again at block 1 and again at block 6, but this is not possible.
As you can see from the web address this is running on google app engine, so as restricted an environment as you can get.