You may need to reinstall your system and/or update your firmware. Here's an excellent question on the problem: https://www.ifixit.com/Answers/View/112430/Erratic+%22Battery+Charging+-Not+charging%22
+
+
UPDATE
+
put the old battery back in, run Coconut Battery and post your results. Tell us if the battery gives you a red or black X.
You may need to reinstall your system and/or update your firmware. Here's an excellent question on the problem: https://www.ifixit.com/Answers/View/112430/Erratic+%22Battery+Charging+-Not+charging%22