Salary during notice period and experience letter

Hello, I'm employed in a IT firm for the last 2 years and I had resigned a month ago. My offer letter states that I have to serve 3 months notice period to train the replacement or I can buy the notice period. I mailed the firm that I am willing to serve 3months of notice period but my company is not accepting my resignation nor approving me to relieve after 3 months. They are asking me to extend and stay till the current project ends, which I told them I can't stay back. The management is saying that I can't leave the project in between, but I had mailed the management that I might leave the firm even before the project could start. I have proof that I mailed them 2 months before the project starts and I also resigned a month ago. I have 2 more months of notice period but the company is saying that they won't pay my salary during the notice period of 3 months. They are not approving my resignation, nor paying me and torturing me everyday asking me to stay back. In addition to that I had done a certification paid by the company, the validity of this Certification will expire in few months. The company is asking me to payback for the Certification cost. This was not told to me nor asked before completing the certification. In fact I told the management that I might leave the firm even before doing the certification but at that time their primary focus was only on me completing the certification cause the current project dependent on it. Please advise on what can be done, since I need both my salary for the 3 months and my experience letter along with relieving letter which they might not give cause they are not accepting my resignation. Also I can't repay the certification cost. Thanks in advance