Skip to content

Filter payment transactions by method, PO number and overdue; show more on the details screen - #1073

Merged
KrzysztofPajak merged 7 commits into
developfrom
feature/payment-transaction-filters
Nov 19, 2026
Merged

KrzysztofPajak merged 7 commits into
developfrom
feature/payment-transaction-filters

Conversation

@KrzysztofPajak

Copy link
Copy Markdown
Member

Type: feature

Issue

Staff can find a payment transaction only by customer e-mail, order number, status and date. Questions staff actually ask — "which on-account payments are overdue?", "where is the payment for PO 4711?", "what did Stripe take this week?" — need the order list instead, which has those filters. An unknown order number on the transaction list was ignored, so it listed every payment.

The transaction details screen was sparse. The authorization code and result, capture id and result, currency rate and store were in the view but never filled by the controller, so they never showed. The payment errors a failed checkout stores, the gateway's custom values and the order the payment belongs to were not shown at all.

Roadmap item P6.

Solution

Transaction list (Admin and Store)

  • New filters: Payment method, PO number (exact match after trimming, as on the order list) and Overdue payments only (same rule as the order list: PaymentExtensions.UnpaidOnCredit and due date before today; due today is not overdue).
  • GetPaymentTransactionQuery gains PaymentMethodSystemName, PurchaseOrderNumber and OverdueOnly. PO number and due date live on the order, so the handler first reads the matching orders' OrderGuid (store-filtered, not deleted) and keeps the payments of those orders. A filter that matches no order returns nothing.
  • An order number that is not a number or finds no order now returns an empty list instead of every payment.

Transaction details

  • Now filled: authorization code and result, capture id and result, currency rate (shown when not 1), store (Admin panel only; the Store panel sees its own store).
  • New: payment method's friendly name (falls back to the system name when the plugin is gone), an Abandoned checkout chip for a checkout that never got a payment through, Left to pay and Refundable (rounded to the cent), Last changed, Payment errors and Payment method data (the gateway's custom values, as on the order screen).
  • New order card, only when the order exists: order number, order status, order payment status, order total, Billed to (billing company, else first and last name), PO number and due date (moved here). An abandoned transaction no longer renders an empty order link.
  • Resources in DefaultLanguage.xml and Upgrade/en_250.xml.

No migration, no new index, no new setting.

Breaking changes

  • BasePaymentTransactionController takes three more constructor parameters (IPaymentService, IStoreService, IOrderStatusService), and its List() GET is now async Task<IActionResult>. A subclass outside this repository has to forward them.
  • GetPaymentTransactionQueryHandler takes IRepository<Order> as well.

Testing

  1. Sales → Payment transactions: pick a payment method → only its payments. Enter a PO number with spaces around it → the payment of that order. Tick "Overdue payments only" → only payments of on-account orders past their due date (due today is not listed).
  2. Enter an order number that does not exist, or letters → empty list.
  3. Store panel: the same filters; a PO number used by another store's order shows nothing.
  4. Open a paid, a partially paid and an abandoned (Temp) transaction: amounts left are shown to the cent, the order card appears only with an order, payment errors and gateway data appear when stored.
  5. dotnet test: Grand.Business.Checkout.Tests 944, Grand.Web.Admin.Tests 2074, Grand.Web.Store.Tests 241 passed. Not checked in a browser (this worktree has no installed database).

support added 5 commits November 19, 2026 17:21
The PO number and the due date live on the order, so the handler finds the matching orders first and keeps the payments of those orders; overdue is the same rule as the order list.
An order number that finds no order now finds no payment, instead of listing every payment.
The authorization code and result, the capture id and result, the currency rate and the store were in the view but never filled. The screen now also shows the payment errors, the gateway's custom values, what is left to pay and to refund, an abandoned-checkout chip, the last change, and an order card with its status, payment status, total and billing name.
Amounts paid in parts add up with floating-point residue, so a 123.45 payment with 100 paid showed 23.450000000000003 left.
Copilot AI balanced review requested due to automatic review settings November 19, 2026 17:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

</div>
}
@if (Model.PaymentDueDate.HasValue)
@if (Model.CurrencyRate > 0 && Model.CurrencyRate != 1)
support added 2 commits November 19, 2026 18:34
…ilters

The payment rules, the popups and the details screen now count what is left the same way, with the floating-point residue of part payments rounded off. The order list and the payment transaction list filter overdue orders and purchase order numbers through one rule.
- the store panel lists only its own store's payment methods (payment transactions and orders), built in one place
- left to pay is shown only while the transaction can still be paid; refundable is the refund limit, shown only while a refund can be made
- a Temp transaction is marked 'Checkout not completed' rather than abandoned: it may still be in progress at the gateway
- last changed is formatted like created on
- Go to order number ignores a number that is not a number
@KrzysztofPajak
KrzysztofPajak merged commit d465d3d into develop Nov 19, 2026
9 checks passed
@KrzysztofPajak
KrzysztofPajak deleted the feature/payment-transaction-filters branch November 19, 2026 18:39
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.

2 participants