How to fix iPhone 5s charger?

So my charger was working perfectly fine all day until it stopped. My charger only works when my phone completely dies and the charger charges it until it's at 1%-5% only. After it turns on the charger stops working. Is there anything to do to fix it since it somehow works? Or is it completely done?

Buy a new one man your sol