Skip to content

feat: added cvcIcon prop#1582

Merged
ArushKapoorJuspay merged 1 commit into
mainfrom
feat/added-cvc-icon-prop
May 25, 2026
Merged

feat: added cvcIcon prop#1582
ArushKapoorJuspay merged 1 commit into
mainfrom
feat/added-cvc-icon-prop

Conversation

@ArushKapoorJuspay

Copy link
Copy Markdown
Collaborator

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Adds a new merchant-facing cvcIcon option to the Payment Element that allows hiding the CVC/CVV icon inside the CVC input field.

Usage

elements.create("payment", {
  cvcIcon: "hidden"   // hides the CVC icon
  // cvcIcon: "default" or omit — shows the icon (default behaviour)
})

Changes

src/Types/PaymentType.res

  • Defined a new cvcIconStyle variant type: DefaultCvcIcon | HiddenCvcIcon
  • Added cvcIcon: cvcIconStyle to the options record
  • Added cvcIcon: DefaultCvcIcon to defaultOptions
  • Added "cvcIcon" to allowedPaymentElementOptions
  • Added getCvcIconStyle parser with unknownPropValueWarning for invalid values
  • Used getWarningString (consistent with redirectionInfo, branding patterns) in itemToObjMapper
    src/CardUtils.res
  • Added optional ~cvcIcon: PaymentType.cvcIconStyle=DefaultCvcIcon parameter to setRightIconForCvc
  • Returns React.null when cvcIcon is HiddenCvcIcon
    src/Payments/CardPayment.res
  • Passes ~cvcIcon=options.cvcIcon to setRightIconForCvc
    src/Components/DynamicFields.res
  • Destructures cvcIcon from optionAtom
  • Passes ~cvcIcon to both setRightIconForCvc call sites (CardCvc and CardExpiryAndCvc branches)

How did you test it?

cvcIcon: "default"

Screenshot 2026-05-25 at 3 49 59 PM

cvcIcon: "hidden"

Screenshot 2026-05-25 at 3 50 41 PM

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

@semanticdiff-com

Copy link
Copy Markdown

Review changes with  SemanticDiff

@github-actions

Copy link
Copy Markdown
Contributor

🚫 Missing Linked Issue

Hi 👋 This pull request does not appear to be linked to any open issue yet.

Linking your PR to an issue helps keep the project tidy and ensures the issue is closed automatically.

✔️ How to fix this

  • Add a keyword like Fixes #123 or Closes #456 to your PR description or a commit message.
  • Or link it manually using the "Linked issues" panel in the PR sidebar.

Tip: You can link multiple issues.
🚫 Note: If only one issue is linked, it must be open for this check to pass.

Once linked, this check will pass automatically on your next push or when you re-run the workflow.

Thanks for helping maintainers! 🙌

@ArushKapoorJuspay ArushKapoorJuspay merged commit 768a1fc into main May 25, 2026
10 of 12 checks passed
@ArushKapoorJuspay ArushKapoorJuspay deleted the feat/added-cvc-icon-prop branch May 25, 2026 10:28
@github-actions github-actions Bot added the Closed Label will be automatically added when the PR will get merged to main label May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Closed Label will be automatically added when the PR will get merged to main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cvcIcon prop to hide CVC icon in Card Payment Form

2 participants