Time to inspect your MagSafe charger!
First lets check the cord does it have any damage like this:
Next we need to inspect the contacts are the outer pins at the same distance out?
Next we need to inspect the system is the contacts clean and in good shape as well as the insulator?
Yours should look like the bottom nice and clean
Is your contacts burn’t like this one
Let us know what you discover.
Us some isopropyl alcohol and a cotton swab (Q-Tip) to clean the junk off and use a fresh pink pencil eraser (still soft) to polish the contacts.
Otherwise its time for a new charger Apple 45W MagSafe 2 Power Adapter for MacBook Air
Get it directly from Apple don’t go cheap! the knockoffs kill systems and can also cause fires! I can tell you of a how the company I was working for ended up paying over 2 million in damages because an employee had forgotten his charger and bought knockoff only to set the hotel he was staying at a blaze!
You may need a newMacBook Air 13" (Mid 2012) I/O Board if the contacts can’t be cleaned, here’s the guide to put it in MacBook Air 13" Mid 2012 I/O Board Replacement