Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECP-9491] Refactor instantiating AdyenCheckout library and components #2770

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

candemiralp
Copy link
Member

@candemiralp candemiralp commented Oct 14, 2024

Description

The plugin currently builds AdyenCheckout library object as much as the number of the payment methods enabled on the checkout and mounts all of the payment components at the same time after rendering the checkout.

This results in delays on the checkout since AdyenCheckout library makes multiple calls to checkoutshopper endpoints after instantiation for collecting data for risk calculation. This causes a drastic performance degradation on the checkout page.

Ideally, AdyenCheckout library object should be instantiated after a shopper selects an Adyen payment method. This PR introduces a refactoring which changes the logic of instantiating the AdyenCheckout library and mount payment method components.

Tested scenarios

  • Rendering checkout and selecting a payment method triggers single call to checkoutshopper
  • Pre-selected payment method triggers single call to checkoutshopper
  • checkoutshopper endpoint is not called if no Adyen payment method is selected

Fixes #2766
Fixes #2581

peterojo
peterojo previously approved these changes Oct 15, 2024
Copy link

sonarcloud bot commented Nov 6, 2024

Please retry analysis of this Pull-Request directly on SonarCloud

Copy link

sonarcloud bot commented Nov 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants