Fix Course Enrollment After Payment

Customer: AI | Published: 16.03.2026

My custom-built site is successfully collecting payments through Razorpay, but once a transaction completes the corresponding course is not being assigned to the buyer. Students show up as “paid” in the database, yet their accounts remain stuck without the correct course permissions, so they cannot start the lessons they paid for. I need you to trace and repair whatever is breaking in the post-payment workflow. That includes: • Reviewing the Razorpay webhook / callback that should trigger enrollment • Checking the course-assignment logic inside the current codebase (no off-the-shelf LMS; it’s a home-grown module) • Making sure successful transactions translate into immediate, automatic course access for the student, with graceful error handling and clear logging for failures You will receive access to the staging server, payment gateway test keys, and a sample purchase flow to replicate the bug. Please document the root cause and provide the patched code or migration script so I can deploy it to production confidently.