Check the battery health - go to apple menu - system info then I think there's a tab for the battery there. If the battery health is bad, then the battery needs replacing. Not sure if your model would have the battery built in (i.e. you cannot remove it yourself) but if that's the case, the only fix would be Apple repair. If you can remove the battery yourself, you can buy a new battery.
If its not the battery health, then might be the power adapter but if the computer at least acts like its plugged in (even though the battery is not charging) then I would tend to not think so.
Lastly, what percentage is the battery at? Normally it won't charge if you plug the computer in when the battery is at 96% or greater. It will only charge to 100% if you plug it in and leave it plugged in when the battery is at 95% or less and you leave it plugged in until its fully charged. This is by design to preserve overall battery life.