There seems to be soft tissue injury in middle finger.. There is a possibility of fracture in such cases..
Next Steps
You should start with Ice fomentation, take analgesic with anti inflammatory medicine, apply a finger splint or strapping for support..
If pain and swelling persists, better to go for X ray of Hand specially middle finger AP and lateral view..
Health Tips
Avoid heavy work with hand, avoid jerky movements of finger..