Lab test process

Hello,
In healthcare domain, a patient is eligible for lab test only when the patient is done invoice payment. Else it should show a pop up/message that payment is not done. How can be achieved this ?

same question also suffer