Shocked

So I ended up being pregnant on my side it was unwanted and my mother wanted me to keep it and so I had to legally buy a few days ago I actually miscarried the baby was about a month and I’m just shocked and I don’t know how to tell the father cause he had just got on board with the whole fathering thing. What should I do? I’m j so out of it and my body is in pain that I don’t know what to do