Yikes, I've never had to do this, and where, oh where, did you find a replacement spring? Well done.
I don't have many ideas how to put the pin back in perfectly, such that a concourse judge cannot tell, but who looks at the latch with any scrutiny?
If you measure the diameter of that shaft, you may find something suitable at a hardware store, or automotive/truck parts supply. One thought is using a roll pin heated with a torch and peened at the ends to stay in place. But heating this way may discolor the latch.
If you're set on putting it back so one cannot tell it was repaired, it may be easier to just find another latch assembly. I've seen a good number of hoods at swap meets for sale with this latch still attached.
Otherwise, cold peening (in my opinion) is your best bet. But this may require tools you don't have. I'm sure there are lots of YouTube videos on this topic. Knife makers cold peen the pins that hold the wooden handles to the knife blade. Heating with a torch isn't an option with wood!
One example:
Finding the pin in the correct diameter may be just as challenging as a rolled pin. But with some patience and the right bench setup, this seems a pretty good way to go.