SL-375 Fix Saferpay Fields CVC and loading states in checkout - #343
Merged
TLabutis merged 1 commit intoJul 30, 2026
Merged
Conversation
Two states where a card field was drawn as fully usable while it could not be typed into, so customers read the form as broken. CVC: the SDK keeps the CVC input disabled until the card number passes its CheckCard lookup. The injected .form-control rule had no :disabled variant, so the disabled input kept the text cursor, the normal text colour and a live caret colour. Add the :disabled rule (with -webkit-text-fill-color, since Blink and WebKit override color on a disabled input) and mirror the lock on the fieldset through an is-locked class, driven by card-number validity in onValidated and cleared in onFocus. Loading: the field iframes were hidden with opacity 0 until the SDK reported success, but an invisible iframe still takes clicks and keystrokes, so a customer clicking during init typed into a field they could not see. Add pointer-events: none for that window and mute the fieldsets so the state is legible before the click. The loading class now also has a fallback timeout. Verified with the field iframe requests blocked: the SDK calls neither onSuccess nor onError, so a class gated only on those callbacks would leave the form permanently inert.
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
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.
QA follow-up on SL-375. Two states where a Saferpay Fields card field is drawn as fully usable while it cannot be typed into, so the form reads as broken.
1. CVC field looks editable while the card number is incomplete
The SDK keeps the CVC input
disableduntil the card number passes itsCheckCardlookup, and the injected.form-controlrule had no:disabledvariant. The disabled input therefore kept the text cursor on hover, the normal text colour and a live caret colour, so clicking it gave no caret and dropped every keystroke..form-control:disabledto the injected style:cursor: not-allowed, muted colour andcaret-color: transparent.-webkit-text-fill-coloris required because Blink and WebKit overridecoloron a disabled input.is-lockedclass, driven by card-number validity inonValidatedand cleared inonFocusfor the CVC (a disabled input cannot take focus, so reaching it proves the SDK unlocked it).The field is deliberately not rendered pre-locked: with an untouched card number the CVC is genuinely enabled and typeable, so pre-locking would grey out a usable field.
disabledcursortextrgb(31,36,38)1234567890123456, blurrednot-allowedrgb(154,164,168)4111111111111111, blurredtextrgb(31,36,38)2. Card form accepted clicks and keystrokes while still loading
The field iframes were hidden with
opacity: 0until the SDK reported success. Anopacity: 0iframe still hit-tests, so a customer clicking a field during init focused the invisible input and the characters they typed landed in a field they could not see. Verified: typedGHOSTduring the window and it went into the holder-name input.Measured window from selecting the payment option, on a low-latency connection:
BODYopacity: 0pointer-events: nonealongsideopacity: 0, so the field is inert while hidden.cursor: progress), sharing declarations withis-lockedsince both mean "drawn but not typeable". Both are declared ahead of the focus/error rules so those still take precedence.Fallback timeout
The loading class now also has a 10s fallback, cleared in
onSuccess,onErrorandremoveSlot. Verified by blocking the field iframe requests: the SDK calls neitheronSuccessnoronError, so a class gated only on those callbacks stays on forever. Combined withpointer-events: nonethat would leave the form permanently inert, which is worse than the original bug. With the timer it recovers.Not changed, ruled out with evidence
The unconditional
cvcentry in the submit gate'sREQUIRED_FIELDSwas suspected of deadlocking cards without a mandatory CVC. Bancontact BIN6703444444444449(isCvcMandatory: false) with a blank CVC returned{"success":true}fromStoreand the gate did not block: the SDK reports an empty CVC as valid when it is not mandatory.reEnablePlaceOrder()also already covers all four failure branches.Testing
PS 8.2.3 / PHP 8.1, Chromium, live test terminal. All four field states verified through the real cross-origin iframes, including that the injected
:disabledrule reaches the iframe's owndocument.styleSheets. Also checked that the muted loading and locked looks do not overridehas-errororis-focused, that typing works normally once ready (JOHN DOE, CVC456), and that a full submit still reachesStore.Changelog updated in the 2.1.0 section.