Skip to content

Conversation

@sponglord
Copy link
Contributor

@sponglord sponglord commented Dec 17, 2025

📋 Pull Request Checklist

  • I have added unit tests to cover my changes.
  • I have added or updated Storybook stories where applicable.
  • I have tested the changes manually in the local environment.
  • I have checked that no PII data is being sent on analytics events
  • All E2E tests are passing, and I have added new tests if necessary.
  • All interfaces and types introduced or updated are strictly typed.

📝 Summary

This PR removes code that manually add props to the 3DS2 component via a hardcoded "list". This was legacy code from v5 and is no longer required.
Also strengthened the types used in the handling of a 3DS2 action


🧪 Tested scenarios


🔗 Related GitHub Issue / Internal Ticket number

Closes:


@sponglord sponglord requested a review from a team as a code owner December 17, 2025 13:56
@sponglord sponglord requested a review from johnayeni December 17, 2025 13:56
@changeset-bot
Copy link

changeset-bot bot commented Dec 17, 2025

🦋 Changeset detected

Latest commit: 428bac9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@adyen/adyen-web Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Dec 17, 2025

Deploy Preview for adyen-web ready!

Name Link
🔨 Latest commit 428bac9
🔍 Latest deploy log https://app.netlify.com/projects/adyen-web/deploys/69493f2572f3ed000894d6f1
😎 Deploy Preview https://deploy-preview-3719.checkout-web-dev.adyen.com
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sponglord sponglord marked this pull request as draft December 17, 2025 13:57
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @sponglord, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the robustness and maintainability of the 3DS2 payment flow by introducing comprehensive type definitions and refactoring key utility functions. The changes ensure that properties, especially challengeWindowSize, are handled consistently and safely across different payment components, leading to a more predictable and error-resistant system for processing 3DS2 actions.

Highlights

  • 3DS2 Type Strengthening: Introduced new TypeScript types, ChallengeWindowSize, ThreeDS2FlowPropsReturnObject, ThreeDS2ConfigProps, and ActionHandlerConfig, to enhance type safety and clarity in 3DS2 action handling across various components.
  • Challenge Window Size Standardization: Standardized the challengeWindowSize property type in Card, CustomCard, and GooglePay configurations by replacing literal union types with the newly defined ChallengeWindowSize type.
  • Refactored 3DS2 Flow Props Utility: The get3DS2FlowProps utility function was refactored to simplify its logic and leverage the new ThreeDS2FlowPropsReturnObject type, removing legacy prop handling.
  • Improved Debugging & Comments: Added specific console.log statements for debugging onAdditionalDetails in UIElement and ACTION:CHALLENGE in callSubmit3DS2Fingerprint, and updated comments in ThreeDS2Challenge and ThreeDS2DeviceFingerprint for clarity.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively refactors the 3DS2 component handling by centralizing the ChallengeWindowSize type and strengthening the types for action handling, which improves code maintainability and safety. The removal of legacy properties from the utility function is also a good cleanup step. My review includes suggestions to remove some leftover debugging statements and to further improve type safety in one of the modified functions.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

size-limit report 📦

Path Size
UMD 113.88 KB (-0.04% 🔽)
Auto 120.25 KB (+0.04% 🔺)
ESM - Core 25.4 KB (-0.2% 🔽)
ESM - Core + Card 64.58 KB (-0.16% 🔽)
ESM - Core + Dropin with Card 71.2 KB (-0.1% 🔽)

@sponglord
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a solid refactoring effort that removes legacy code and strengthens the typing around the 3DS2 action handling. Centralizing the ChallengeWindowSize type and introducing ThreeDS2ConfigProps and ActionHandlerConfig significantly improves code clarity and maintainability. The changes are well-aligned with the goal of manually adding props to the 3DS2 component and moving away from older patterns. I've found one minor issue regarding a debug console.log that should be removed.

@sponglord
Copy link
Contributor Author

/gemini summary

@gemini-code-assist
Copy link
Contributor

Summary of Changes

This pull request focuses on modernizing and improving the 3DS2 payment flow by removing legacy code and significantly enhancing type safety. The changes standardize how 3DS2 properties are handled across various components, making the system more robust, maintainable, and predictable for future development and debugging.

Highlights

  • Enhanced Type Safety for 3DS2: Introduced new TypeScript types (ChallengeWindowSize, ThreeDS2FlowPropsReturnObject, ThreeDS2ConfigProps, ActionHandlerConfig) to significantly strengthen type definitions and ensure consistency across 3DS2 action handling.
  • Standardized challengeWindowSize Property: Replaced literal union types with the new ChallengeWindowSize type in Card, CustomCard, and GooglePay configurations, promoting reusability and type consistency.
  • Refactored 3DS2 Flow Utility: Simplified the get3DS2FlowProps utility function by removing legacy prop handling and explicitly typing its parameters and return value, aligning with the overall type strengthening effort.
  • Removal of Legacy 3DS2 Props: Eliminated outdated logic for manually adding props to the 3DS2 component, streamlining the codebase and removing remnants of v5 legacy code.
  • Improved Code Clarity and Debugging: Updated comments in 3DS2 components and removed a debug console.debug statement, contributing to a cleaner and more understandable codebase.
Changelog
  • packages/lib/src/components/Card/types.ts
    • Imported ChallengeWindowSize type.
    • Updated challengeWindowSize property to use the new ChallengeWindowSize type.
  • packages/lib/src/components/CustomCard/types.ts
    • Imported ChallengeWindowSize type.
    • Updated challengeWindowSize property to use the new ChallengeWindowSize type.
  • packages/lib/src/components/GooglePay/types.ts
    • Imported ChallengeWindowSize type.
    • Updated challengeWindowSize property to use the new ChallengeWindowSize type.
  • packages/lib/src/components/ThreeDS2/ThreeDS2Challenge.tsx
    • Updated the comment for the beforeRender method for clarity.
  • packages/lib/src/components/ThreeDS2/ThreeDS2DeviceFingerprint.tsx
    • Updated the comment for the beforeRender method for clarity.
  • packages/lib/src/components/ThreeDS2/callSubmit3DS2Fingerprint.ts
    • Removed a console.debug statement.
  • packages/lib/src/components/ThreeDS2/components/utils.ts
    • Updated imports to use the type keyword.
    • Removed fingerprintFlowPropsDropin and fingerprintFlowProps variables.
    • Refactored get3DS2FlowProps to use new types and simplify its logic.
  • packages/lib/src/components/ThreeDS2/types.ts
    • Defined new types: ChallengeWindowSize, ThreeDS2FlowPropsReturnObject, and ThreeDS2ConfigProps.
    • Updated challengeWindowSize property in ThreeDS2Configuration to use the new ChallengeWindowSize type.
  • packages/lib/src/core/ProcessResponse/PaymentAction/actionTypes.ts
    • Updated imports to use the type keyword.
    • Added explicit types to getActionHandler and threeDS2 function parameters and return values.
    • Typed the config object in threeDS2 as ThreeDS2ConfigProps.
  • packages/lib/src/core/ProcessResponse/PaymentAction/types.ts
    • Added a new file defining the ActionHandlerConfig type.
Activity
  • The changeset-bot noted that no changeset was found, advising to add one if a version bump is required.
  • Netlify provided a deploy preview link for the changes.
  • Gemini Code Assist provided an initial summary of the changes and highlights.
  • GitHub Actions reported on the size-limit of the bundles, showing minor changes.
  • The author, sponglord, requested a review from Gemini Code Assist.
  • SonarQube Cloud reported that the Quality Gate passed, with 4 new issues and 90.0% coverage on new code.
  • The author, sponglord, requested a summary from Gemini Code Assist.
  • Gemini Code Assist left multiple review comments suggesting the removal of debug console.log statements across several files.
  • Gemini Code Assist also suggested adding explicit types to parameters in the get3DS2FlowProps function for improved type safety and clarity.

@sponglord sponglord force-pushed the chore/removing_fingerprintProps_from_util branch from 478db1b to b84610d Compare December 18, 2025 14:44
@sponglord sponglord force-pushed the chore/removing_fingerprintProps_from_util branch from b84610d to 02f4633 Compare December 22, 2025 11:09
@sonarqubecloud
Copy link

@sponglord sponglord marked this pull request as ready for review December 22, 2025 14:11
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.

1 participant