Skip to content

fix(portal): submit checkout payments with CSRF protection - #414

Open
Pandiyan5273 wants to merge 2 commits into
frappe:developfrom
Pandiyan5273:fix/develop-checkout-payment-post
Open

Pandiyan5273 wants to merge 2 commits into
frappe:developfrom
Pandiyan5273:fix/develop-checkout-payment-post

Conversation

@Pandiyan5273

@Pandiyan5273 Pandiyan5273 commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Issue

Steps to replicate

  • Install Payments and Webshop, configure a payment gateway account, and enable checkout.
  • Link a website user with the Customer role to a customer and submit an unpaid Sales Order for that customer.
  • Sign in as that user, open the order page, and click Pay.
  • Also open a submitted Sales Invoice for 1,000 with 400 already paid.

Actual behavior

  • Pay sends GET to the POST-only endpoint and is rejected.
  • The partially paid invoice displays Pay 1,000 even though only 600 remains payable.

Expected behavior

  • Pay submits a POST form with the session CSRF token and redirects to the configured gateway.
  • The button displays the payable balance and is hidden for draft, cancelled, fully paid, or unauthorized documents.

Backport needed

  • Version 16: Yes. The same GET link exists at Webshop 5ba16567c0; the prepared version-16 companion also requires ERPNext's portal-customer permission fix. Both changes passed the v16 server flows described in their PRs.
  • Version 15: Yes, by code inspection at Webshop a355cdad44 and ERPNext d17086df9f. The GET link remains and ERPNext lacks the customer permission path; coordinated adaptations and v15 runtime validation are still required.

Companion PRs

@mergify

mergify Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@Pandiyan5273
Pandiyan5273 force-pushed the fix/develop-checkout-payment-post branch from 74cbb75 to 4406457 Compare November 5, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant