Skip to content

[ECP-9940] Fix missing countryId for virtual product payments#3282

Merged
candemiralp merged 3 commits into
mainfrom
ECP-9940
Mar 26, 2026
Merged

[ECP-9940] Fix missing countryId for virtual product payments#3282
candemiralp merged 3 commits into
mainfrom
ECP-9940

Conversation

@candemiralp

@candemiralp candemiralp commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Description

It has been observed that the plugin was unable to mount the checkout component due to missing countryId while initiating a payment method. The root cause behind was the billing address assignment is delayed and payment methods used to be rendered earlier.

With this fix, the plugin observes the countryId before mounting the checkout component.

Tested scenarios

Following cases manually testes for both virtual and standard products with guest and logged-in shoppers.

  • Card w/wo 3DS2
  • Card recurring
  • Wallets (PayPal + Google Pay)
  • Gift card payments
  • Redirect (Ideal + Klarna)

Fixes #3270

@candemiralp candemiralp added the Fix Indicates a bug fix label Mar 25, 2026
@candemiralp candemiralp requested a review from a team as a code owner March 25, 2026 10:43
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 addresses a critical issue where the Adyen checkout component failed to mount for virtual product payments due to the countryId being unavailable at the time of initialization. By introducing an observable pattern, the payment methods now wait for the billing address, and consequently the countryId, to be present before proceeding with the component's creation, ensuring a robust payment experience across all product types.

Highlights

  • Payment Component Initialization: Modified payment method renderers to observe the billing address for the countryId before attempting to build and mount the Adyen checkout component. This resolves issues where the countryId might not be immediately available, especially for virtual products.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

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.

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

Copy link
Copy Markdown
Contributor

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 several Adyen payment method renderer files (adyen-cc-method.js, adyen-cc-vault-method.js, adyen-pm-method.js, adyen-giftcard-method.js) and the giftcard-form.html template. The primary goal is to ensure Adyen checkout components are only built or gift card forms displayed when the billing address and its country ID are available, introducing conditional component creation and subscriptions to quote.billingAddress. However, the review identified several issues: the adyen-pm-method.js implementation lacks the necessary subscription to billingAddressObservable to create the component when the country ID becomes available, which is a critical bug. Additionally, the subscriptions in adyen-cc-method.js and adyen-cc-vault-method.js are not disposed, potentially causing memory leaks and unexpected behavior. Finally, the billingAddressAvailable observable in adyen-giftcard-method.js is not reactive and may prevent the gift card form from being displayed if the billing address is not initially present.

@sonarqubecloud

Copy link
Copy Markdown

@candemiralp candemiralp merged commit b37ca3e into main Mar 26, 2026
13 of 15 checks passed
@candemiralp candemiralp deleted the ECP-9940 branch March 26, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fix Indicates a bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: JS error when buying virtual product as guest checkout

3 participants