Skip to content

15 use npm for adyenadyen web#35

Merged
remcotolsma merged 5 commits intomainfrom
15-use-npm-for-adyenadyen-web
Oct 6, 2025
Merged

15 use npm for adyenadyen web#35
remcotolsma merged 5 commits intomainfrom
15-use-npm-for-adyenadyen-web

Conversation

@remcotolsma
Copy link
Copy Markdown
Member

No description provided.

@remcotolsma remcotolsma self-assigned this Oct 6, 2025
@remcotolsma remcotolsma linked an issue Oct 6, 2025 that may be closed by this pull request
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @remcotolsma, 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 modernizes the integration of the Adyen Web SDK by transitioning from a direct script loading mechanism to an npm-managed dependency. This change streamlines dependency management, improves the build process, and ensures that the Adyen components are loaded and utilized as modules within the application's JavaScript, enhancing maintainability and consistency.

Highlights

  • Adyen Web SDK Integration: The Adyen Web SDK is now integrated via npm, replacing the previous method of loading the adyen.js script directly from a URL.
  • JavaScript Module System: The JavaScript code has been updated to import AdyenCheckout and Dropin components directly from the @adyen/adyen-web/auto npm package, removing reliance on global window.AdyenWeb objects.
  • PHP Script Management: The PHP script registration has been adjusted to remove the explicit registration of the adyen.js script and update dependencies for the checkout-drop-in.js script, aligning with the new npm-based approach.
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
Copy Markdown

@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 updates the Adyen Web integration to use an npm package instead of a CDN script, which is a good modernization. The changes to use the npm package are mostly correct, but I've identified a couple of follow-up changes required in the PHP code. There's a call to print a script that is no longer registered, which will cause an error. Additionally, there's now a version mismatch between the JavaScript library and the stylesheet being loaded, which could lead to visual bugs. My review includes details on how to fix these issues.

@remcotolsma
Copy link
Copy Markdown
Member Author

/gemini review

Copy link
Copy Markdown

@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 refactors the Adyen Web integration to use the @adyen/adyen-web NPM package instead of loading the script from a CDN. This is a great improvement for managing dependencies. The changes involve updating the JavaScript to import from the package, adding the dependency to package.json, and updating the PHP code to remove the old script registration. The code is well-structured, but I have one suggestion to make it more robust when handling script dependencies.

src/Gateway.php Outdated
'pronamic-pay-adyen-checkout-drop-in',
\plugins_url( '../js/dist/checkout-drop-in.js', __FILE__ ),
[ 'pronamic-pay-adyen-checkout' ],
[],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

While the dependencies array in checkout-drop-in.asset.php is currently empty, it's a best practice to use the dependencies array from the asset file here instead of hardcoding an empty array. This makes the code more robust and future-proof. If wp-scripts adds any dependencies in the future (e.g., from other @wordpress packages), they will be automatically handled without needing to change this line.

            $asset['dependencies'],

@remcotolsma remcotolsma merged commit 51cd48c into main Oct 6, 2025
8 of 19 checks passed
@remcotolsma remcotolsma deleted the 15-use-npm-for-adyenadyen-web branch October 6, 2025 11:06
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.

Use npm for Adyen/adyen-web

1 participant