Repository navigation
PRE-3709: Fix co-branded network selector in Hosted Fields - #334
Merged
adumont-payplug merged 1 commit intoOct 5, 2026
Merged
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio. |
The brand iframe sat in a fixed 90x42px box with hidden overflow, so logos were cut for co-branded cards. The SDK label for choosing a network is an absolutely positioned div in body with coordinates measured once, so it landed on the expiry and CVV fields. - Card field gets its own row. A network row under it holds our own label and tooltip on the left and the brand iframe (170x44px) on the right. - Hide the SDK element #info-container. Show our in-flow label only while the SDK reveals its own, so single-brand cards get no label. Tooltip is CSS-only, fr, en and it. - Remove the static CB scheme badge. - Reject CB: drop it from ALLOWED_BRANDS in the JS controller and in its mirror in PayplugCardPersister. Relies on :has() (Chrome 105+, Safari 15.4+, Firefox 121+) and on the SDK keeping the #info-container id and its inline display toggle. Re-check on SDK upgrades.
adumont-payplug
force-pushed
the
fix/PRE-3709-cobranded-brand-selector
branch
from
October 2, 2026 09:47
38f5361 to
5863050
Compare
There was a problem hiding this comment.
Claude Code Review
Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.
Tip: disable this comment in your organization's Code Review settings.
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.
Description
With Unified Hosted Fields, a co-branded card makes the Dalenys brand iframe show several network logos plus a "Sélectionnez votre réseau (i)" label and tooltip. The iframe sat in a fixed 90x42px
overflow: hiddenbox, so logos were cut off. The label is an absolutely positioned<div id="info-container">that the SDK adds directly under<body>, with pixel coordinates measured once, so it landed on top of the expiry and CVV fields.What changed:
#info-containeris hidden. Our label is shown only while the SDK reveals its own (body:has(...)on its inlinedisplay), so single-brand cards get no label.hosted_fields.network_selection.labeland.tooltip).ALLOWED_BRANDSinhosted-fields_controller.jsand from its server-side mirror inPayplugCardPersister. A shopper who picks CB in the SDK selector now gets the existing "unsupported brand" error.Motivation: CB is not supported on this payment method, and co-branded cards could not be paid reliably because the selector and its label were unusable.
Related issue(s): PRE-3709
Notes for reviewer:
#info-containerid and its inlinedisplay: nonetoggle. If an SDK upgrade changes either, our label stops appearing or the SDK's own label shows again. The brand iframe layout is not affected. Re-check on SDK upgrades.:has()needs Chrome 105+, Safari 15.4+ or Firefox 121+. On older browsers the SDK label stays visible and ours never shows, which is the same as before this change.ecs,phpstan, PHPUnit (602 tests) andtwigcspass. The persister change was written test-first.phpmdfails on 43 violations that exist without this change (same count with it stashed).CHANGELOG.mdis not maintained (it still only has a 2.0.0 section).hosted-fields.cssis the tracked built file (there is no SCSS source in this repo), so it was edited directly.Type of Change
Checklist
Code Quality
Testing
sonarcloudCI jobSecurity & Ops
Result (QA shop, Hosted Fields):
Single-brand test card: no network label, one logo right-aligned, VISA and MC badges only (CB badge removed).
Co-branded test card: label and tooltip trigger on the left, CB and VISA choices on the right, nothing overlapping expiry or CVV.
Co-branded card with CB selected: CB is rejected with the existing unsupported brand message.