As you can see from the extension that you have, the spring and ball were inserted into the hole, before a hollow punch was used to peen over material around the entrance to the hole.
Certainly, that’s how I make them; I this case, I think I used a press, rather than a hammer and punch.

This is a ½” – ¾” adaptor, which I’ve never seen for sale; I bought a ¾” ratchet second hand, without a drive piece.
Made out of some EN19 I had in stock; the surface finish is rather better than it appears, as the flash highlighted the markings.
Make sure you leave enough clearance in the hole around the ball, as grit can gain entry and jam it up.
Bill