Surface charged-back payments as admin navbar notifications - #7
Merged
Conversation
A chargeback deliberately never transitions the Sylius payment - the dispute is handled in the EveryPay merchant portal - but the only trace so far was a log warning that shop staff never see. Every payment whose stored EveryPay state is charged_back now appears in the admin navbar bell, with a link to the merchant portal for live payments (the configured white-label address, or the standard EveryPay portal). The notification provider is registered only when SyliusAdminBundle is present, mirroring the shop-bundle seam, and the notifications component template is swapped for one that can render an optional link per notification - message-only notifications from other providers render exactly as before. The state mapping and the synchronizer stay untouched.
acirtautas
force-pushed
the
chargeback-notification
branch
from
August 5, 2026 13:19
41d5c8e to
e670890
Compare
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.
Problem
A chargeback deliberately never transitions the Sylius payment (the dispute is handled in the EveryPay merchant portal), but the only trace was a
warninglog entry from the synchronizer - invisible to shop staff. A charged-back order could go unnoticed until the accounting did not add up.Change
ChargedBackPaymentNotificationProvider(Sylius admin notification pipeline, tagsylius_admin.notification): every payment whose stored EveryPay state ischarged_backappears in the admin navbar bell, newest first, capped at 10. The notification carries the order number and - for live payments - a link to the merchant portal (the configured white-label address, or the standard EveryPay portal). It stays visible until the dispute resolution callback updates the stored state.sylius_admin:navbar:notificationscomponent template is swapped (via the existing twig-hooks file) for one with identical stock markup plus an optional link per notification; message-only notifications from other providers render exactly as before. If another plugin swaps the template again, only the link degrades away.src/Notification/is excluded from the service prototype andconfig/services/integrations/sylius_admin.phploads only whenSyliusAdminBundleis registered - shopless/adminless containers keep compiling.EveryPayGateway::merchantPortalUrlFrom()(unit-tested); the state mapping and synchronizer are untouched.Tests
merchantPortalUrlFrom().Translations
All four locales updated (en, lt, et, lv). Estonian and Latvian are machine-assisted: the chargeback phrasing ("makse vaidlustati" / "maksājums tika apstrīdēts") deserves a native check - the intent is "the payment was disputed/charged back".
Gates
phpunit(both suites),phpstanlevel 9,ecs,behat --strict- all green, also undercomposer update --prefer-lowest --prefer-stable.