Skip to content

Show Quickpay operation history on the admin order view - #114

Merged
loevgaard merged 5 commits into
2.xfrom
admin-operations-panel
Aug 10, 2026
Merged

Show Quickpay operation history on the admin order view#114
loevgaard merged 5 commits into
2.xfrom
admin-operations-panel

Conversation

@loevgaard

Copy link
Copy Markdown
Member

Fixes #105

What it does

Each Quickpay payment on the admin order view gets a live operation history panel: every operation (type, amount formatted in the payment's currency, qp_status_code + qp_status_msg with the acquirer message as tooltip, pending label, timestamp), the captured balance, and a test-mode badge. No storage, no entities, no migrations — 2.x's scalar quickpayPaymentId is enough to fetch everything on demand.

Deferred, never blocking the order page

  • The panel is a sylius_ui block prepended onto sylius.admin.order.show.payment_content (guarded by hasExtension('sylius_ui')) — it renders only a placeholder for payments carrying a quickpayPaymentId; payments without one get no panel at all
  • A small inline script fetches GET /admin/quickpay/payments/{id}/operations after page load (auto-load with retry, per the issue's suggested default); the /admin path puts the route under the standard Sylius admin firewall/access control
  • Controller/Admin/PaymentOperationsAction resolves the api key from the payment's own gateway config (with the 1.x apikey fallback), fetches via the 5s-capped Quickpay/ClientFactory from Validate Quickpay credentials from the gateway configuration form #106, and renders the partial — any failure returns 502 with an inline notice + retry link, and the retry re-fetches just that payment's panel

Verified

  • Unit: 5 new tests — the happy path drives a real PaymentsEndpoint + Valinor mapper over a realistic snake_case payload (so the DTO mapping is exercised, not stubbed), plus unreachable-API → 502, unknown payment → 404, no quickpayPaymentId → 404, and the extension prepend. 73 tests, PHPStan (cold), ECS, Rector green.
  • Live in the test app: the order page renders instantly with the placeholder, the fetch hits the real Quickpay API server-side (401 with dummy credentials) and the panel swaps to the inline error with a working Retry link — the failure-state UX end to end. lint:container, lint:twig (4 templates), lint:yaml (32 files), debug:router all green.

Labels/messages are translated in all 16 shipped locales (12 new ui.* keys).

Each Quickpay payment on the admin order show page renders a panel with
the payment's live operation history - every operation with type, amount,
Quickpay status code and message, pending flag and timestamp, plus the
captured balance and a test-mode badge. The data is fetched from Quickpay
after the page has rendered (a sylius_ui block placeholder plus a small
fetch script), so the order page is never delayed by a slow gateway;
failures render an inline notice with a retry link. No storage, no
entities, no migrations - the panel reflects what Quickpay reports now.

Fixes #105
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.56098% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.60%. Comparing base (fefde5a) to head (283ccf0).
⚠️ Report is 2 commits behind head on 2.x.

Files with missing lines Patch % Lines
src/Controller/Admin/PaymentOperationsAction.php 96.42% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x     #114      +/-   ##
============================================
+ Coverage     78.03%   79.60%   +1.56%     
- Complexity      105      114       +9     
============================================
  Files            15       16       +1     
  Lines           469      510      +41     
============================================
+ Hits            366      406      +40     
- Misses          103      104       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/Resources/config/routes.yaml Outdated
Admin routes live in routes/admin.yaml imported with the /admin prefix.
The notify endpoint stays directly in routes.yaml on purpose - Quickpay's
servers call it with the URL configured account-wide in the Quickpay
manager, so its path must not depend on the application's locale setup.
Global (unprefixed) routes live in their own file per convention;
routes.yaml only composes the prefixed and unprefixed imports.
Keeps the route under the admin firewall and access control also in
applications that customize the admin path.
The admin operations controller renders templates through Twig\Environment
directly, so the dependency is no longer transitive-only.
@loevgaard
loevgaard merged commit af2574a into 2.x Aug 10, 2026
30 checks passed
@loevgaard
loevgaard deleted the admin-operations-panel branch August 10, 2026 14:15
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.

Show Quickpay operation history on the admin order view

1 participant