The chip which controls the charge if might be fried, did you have a thunder storm recently that could have done this? Another culprit it worn out soldering joints which need resoldered on.
The phone will have to be disassembled to fix it Unfortunately. What’s most likely the problem is the button contact has worn away or the button has been bent out of place when being repaired. To fix this if the contact has worn away is to take it apart and slip small pieces of paper In between the contact and the silicon (if there is any there might not be a silicon pad). This will make up for the space where the contact has worn away. If this is the problem, this is a common issue with Xbox 360 controller RB and LB buttons. If the (button) is bent away from the Contact (the thing you press) you just have to bend it back. I would do this slowly to minimize breaking. If you don’t like the idea of bending something that might break you can always un-solder and re-solder it back on in the correct position. In the event it does break off and it can’t be soldered back on, you can buy a replacement button since those are a pretty common part.