What kind of charger do you use? Original or a generic? If you got a replacement phone (Refurbished), You don't know the history of the Logic Board and what kind of charger the previous owner was using. If you are sure the battery is a good one and the charging port is a good one, I would suspect it is a (U2) issue...Tristar.
Tristar on the Iphone is notorious for burning out due to using "Non" OEM chargers.
It is not a "Diagnosis" per say due to not being able to open and test it...but if you are a bit handy with electronics and know how to use a multimeter, 1st check the battery...Know that the battery you are testing with is 100% a good battery (Not just because you purchased one). 2nd check your charger and lightning cable to make sure they are good OEM ...and 3rd check the charging circuit. Using the multimeter, check the battery connector on the logic board side to see if it is sending current to charge the battery.
If Battery is good, Charger and cable are good, and you are not getting charging voltage, check the charging IC(s) Tristar and Tigris.
Write back with your findings :) Good Luck!