-
Notifications
You must be signed in to change notification settings - Fork 133
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
WIP: Handling multiple instances of the Klarna Widget #2996
Conversation
|
size-limit report 📦
|
Size Change: +680 B (+0.09%) Total Size: 768 kB
ℹ️ View Unchanged
|
…econd or subsequent widgets being present in the same PM list
…naSDK widget if it is re-shown
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
Summary
PR to handle the issue with multiple instances of the Klarna widget being present in the PM list
There are 2 issues:
KlarnaWidget
it loads the KlarnaSDK, which in turn calls the callback we create (window.klarnaAsyncCallback
), which initialises the KlarnaSDK.KlarnaWidget
in the PM list, initialising that will not see the KlarnaSDK calling our callback for a second time, and so the KlarnaSDK is not re-initialised with the rightsdkData.client_token
to make the correct payment.sdkData.client_token
So..
KlarnaWidget
component it checks if it "manually" needs to initialise the KlarnaSDK widget (fixes issue 1)UIElement
to allow it to run some custom logic (onPaymentMethodActive
).This allows the
KlarnaWidget
to "manually" re-initialise the KlarnaSDK. (fixes issue 2)Tested scenarios
... TODO: outline the manual testing undertaken
Existing unit tests adjusted, and all pass
Fixes issue: COWEB-1468