So can I just check
Your middle finger has pain when trying to bend? Are you able to bend it?
Is it swollen?
What is the color?
How long has this been a problem?
Is there any tingling or numbness?
It sounds like you have inflammation in the joint. This can be due to trauma, infection or arthritis.
I would recommend that you use an ibuprofen 5% gel or cream as a local anti-inflammatory agent or take ibuprofen 400mg three times daily for a couple of days. You will need to see a doctor for an examination of the joint to rule out infection, especially if there is any heat in the area.