The incident occurred during Pakistan's chase, in the second innings. After the end of the 10th over, wicket-keeper Niroshan Dickwella lobbed the ball at Kapugedara, who was walking away.
Unfortunately, he did notice the ball and was hit flush on the face, just below his eye, which led to a massive swelling. Luckily, the ball did not his eye.
He was immediately rushed off the field and is currently being treated.