Skip to content

fix(payments): raise clear ValidationError when payment gateway is no…#2461

Open
walidsaleh wants to merge 89 commits into
frappe:developfrom
walidsaleh:fix-lms-billing-permission-error-2457
Open

fix(payments): raise clear ValidationError when payment gateway is no…#2461
walidsaleh wants to merge 89 commits into
frappe:developfrom
walidsaleh:fix-lms-billing-permission-error-2457

Conversation

@walidsaleh

Copy link
Copy Markdown

fix(payments): raise clear ValidationError when payment gateway is not configured

Closes #2457

When LMS Settings.payment_gateway is empty, or points to a Payment
Gateway whose gateway_controller refers to a non-existent Settings
doc, get_payment_link calls frappe.get_doc('Payment Gateway', ),
which raises DoesNotExistError. Frappe re-surfaces this as a
PermissionError toast on the student's checkout page:

El usuario X no tiene acceso a doctype a través del permiso de rol
para el documento Pasarela de Pago

The message is misleading — the student has no permission problem; the
gateway is simply not (or not properly) configured. Validate the
gateway before calling the controller and raise a clear, actionable
ValidationError that the frontend Billing.vue already displays via
the toast.

Also import frappe._ (was missing, the file already used other
Frappe translation patterns in similar code).

pateljannat and others added 30 commits March 4, 2026 10:37
chore: merge 'main-hotfix' into 'main'
chore: merge 'main-hotfix' into 'main'
(cherry picked from commit 7d08a76)
chore: merge 'main-hotfix' into 'main'
chore: merge 'main-hotfix' into 'main'
chore: merge `develop` into `main-hotfix`
fix: course progress updated for scorm and video end event (backport frappe#2247)
(cherry picked from commit 71c13d6)
fix: prevent path transversals in lms (backport frappe#2274)
chore: merge 'main-hotfix' into 'main'
chore: merge `develop` into `main-hotfix`
…2282

fix: prevent unauthorised enrollments in paid courses (backport frappe#2282)
chore: merge `develop` into `main-hotfix`
(cherry picked from commit f244a6c)
raizasafeel and others added 29 commits May 12, 2026 14:09
perf: refactor course outline and lesson to use qb (backport frappe#2381)
…2377

fix: user roles are removed on uninstall (backport frappe#2377)
…2376

fix: timezone now renders for courses and batches (backport frappe#2376)
…2383

fix(quiz): exam submissions and scope check_answer (backport frappe#2383)
…2367

feat: add empty states to settings (backport frappe#2367)
…n-hotfix

chore: merge `develop` into `main-hotfix`
…-main

chore: merge main-hotfix into main
fix: system manager permissions are set properly on install (backport frappe#2399)
chore: merge `develop` into `main-hotfix`
…/main-hotfix-to-main-v2

# Conflicts:
#	lms/patches.txt
…ain-v2

chore: merge `main hotfix` to `main`
chore: merge `develop` into `main-hotfix`
chore: merge `main-hotfix` into `main`
…t configured

Closes frappe#2457

When LMS Settings.payment_gateway is empty, or points to a Payment
Gateway whose gateway_controller refers to a non-existent Settings
doc, get_payment_link calls frappe.get_doc('Payment Gateway', <name>),
which raises DoesNotExistError. Frappe re-surfaces this as a
PermissionError toast on the student's checkout page:

  El usuario X no tiene acceso a doctype a través del permiso de rol
  para el documento Pasarela de Pago

The message is misleading — the student has no permission problem; the
gateway is simply not (or not properly) configured. Validate the
gateway before calling the controller and raise a clear, actionable
ValidationError that the frontend Billing.vue already displays via
the toast.

Also import frappe._ (was missing, the file already used other
Frappe translation patterns in similar code).
@walidsaleh walidsaleh force-pushed the fix-lms-billing-permission-error-2457 branch from 11dd8b3 to 7db6f14 Compare June 13, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants