I would say no, the ruling given to Shylock was not fair, not by a long stretch. He loaned money, and asked for a ridiculous repayment (the pound of flesh). It seems fair enough to deny him that literal pound of flesh. However, to take half his goods seems far too much. Antonio couldn't repay the money he borrowed…so Shylock loses half his goods? How is that fair?
Many other rulings could have been given. For example, the law that is brought out refers to a non-citizen seeking the life of a citizen. Shylock didn't "seek" that life, but asked for it as payment; the Duke could have easily ignored that. More simply, he (or Portia) could have applied it earlier, as a way of nullifying the contract, and that seems much more fair. Antonio had misfortune, and so could be forgiven debt, which would be a Christian thing to do in the best sense of the term. Shylock would be out some money, but not half his goods, which may ruin him forever.