Repository navigation
feat(payments): admin Polar refunds with fee-adjusted policy, admin e… - #236
Open
asifrazadev wants to merge 9 commits into
Open
asifrazadev wants to merge 9 commits into
asifrazadev wants to merge 9 commits into
Conversation
…nrollments page, and free access for course instructors
asifrazadev
marked this pull request as draft
November 14, 2026 09:32
# Conflicts: # frontend/src/components/admin/admin-workspace-shell.tsx # server/src/services/admin/audit.ts # server/src/validations/admin.ts
…s (Full, Standard, Custom), and app settings console
Collaborator
Author
|
I've made a few updates. I still need to test the refund functionality before marking it as ready for merge. Everything else has been confirmed to be working as intended. |
Collaborator
Author
|
The admin enrollment page now lets admins preview refund options and issue full, standard, or custom refunds. The server validates the selected mode and amount, records the decision in the audit log, and revokes course access by default when a refund is issued. The shared admin API types were also synced to the frontend. cc @AQIB-NAWAB |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds admin refunds for courses bought through Polar, a new admin enrollments page, and free access for instructors to their own courses.
Polar refunds
services/payments/refund-policy.ts): a refund returns the amount paid minus Polar's fees: $0.50 transaction fee, 1.5% international fee and 5% Polar fee. Edorax adds no fee of its own. The admin refund, the webhook and the UI all read these numbers from this one file.refund-course-payment.ts): an admin can preview and then issue a refund from the user detail page. The confirm dialog shows every amount. Access ends immediately. It is recorded in the admin audit log.order.refundedwebhook (refund-polar-order.ts,routes/webhook/polar.ts):CANCELLED/DROPPEDand the paymentREFUNDED.Admin enrollments page
/admin/enrollmentslist and/admin/enrollments/[id]detail page. They show what each learner was charged, the coupons or campaigns applied, and the payment status.admin.Instructors get their own courses free
own-course.ts. A course's instructor is never asked to pay; this applies to the catalog, overview, checkout, self-enroll and learn entry points.Tests
refund-policy,refund-course-payment,refund-polar-order,own-course.polar-webhook-route, `admtests.Not included
scripts/backfill-admin-enrollments.ts) will shipseparately.
Test plan
pnpm testandpnpm typecheckinserver/order.refundedand check thate./admin/enrollments, filter, edit d delete an enrollment.