Skip to content

Conversation

sponglord
Copy link
Contributor

@sponglord sponglord commented Jul 25, 2025

Summary

Description:

Some payment actions that lead to a call to onAdditionalDetails, when initiated via checkout.createFromAction, were seeing onAdditionalDetails being called without the actions argument containing the resolve & reject functions. These are needed to complete the flow, as detailed in our documentation.

This applies to threeDS, await & qrCode actions.

Calling checkout.createFromAction means the component that is instantiated just receives the raw, merchant defined, onAdditionalDetails callback, and not the "wrapped" version of this callback that is generated by UIElement.handleAction.

It is this latter, wrapped, version, called within UIElement.handleAdditionalDetails, that creates a Promise that can then be finalised with the resolve & reject functions that are passed, as the third argument, to the merchant's own onAdditionalDetails callback.
Our documentation states that the merchant callback should expect to receive these 2 functions and that they should be called to properly finalise the flow & lead to onPaymentCompleted or onPaymentFailed being called.

Fix:

This PR fixes this problem, within core.ts > createFromAction, by ensuring that the call to onAdditionalDetails (referenced internally as the "onComplete" fn) is always pushed towards the Component (UIElement) handleAdditionalDetails function

Tested scenarios

  • Manually tested threeDS, await (via MBWay) & qrCode (via PromptPay) actions, both with handleAction & createFromAction, to see them complete correctly in both scenarios.

  • Also tested threeDS in the "MDFlow", to see that the onComplete function passed by this flow is called instead of any others.

  • Tested the redirect action to see that this situation didn't arise (checkout.submitDetails, which is called after a redirect, creates its own Promise, with its own resolve & reject functions that can then be use to finalise the payment)

  • Tested the sdk action with the Klarna widget to see that the onComplete for the KlarnaPayments component directly calls it's super.handleAdditionalDetails function. So this issue doesn't arise.

  • Tested that this doesn't apply to bankTransfer actions. (They are concluded in a 3rd party app and not via onAdditionalDetails)

  • Tested that this doesn't apply to voucher actions, since they don't conclude in a call to onAdditionalDetails

  • Also tested how a card and storedCard within the Dropin performed, to ensure the elementRef (which points to the DropinElement) is persisted through the 3DS2 flow and reaches the ThreeDS2Challenge component.

  • Tested that both await & qrCode components also performed correctly within the Dropin

  • All e2e tests pass

  • Additional unit tests added

Copy link

changeset-bot bot commented Jul 25, 2025

⚠️ No Changeset found

Latest commit: a6725df

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

netlify bot commented Jul 25, 2025

Deploy Preview for adyen-web ready!

Name Link
🔨 Latest commit a6725df
🔍 Latest deploy log https://app.netlify.com/projects/adyen-web/deploys/68c14aae6496f9000884e319
😎 Deploy Preview https://deploy-preview-3404.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 July 25, 2025 15:02
Copy link
Contributor

github-actions bot commented Jul 25, 2025

size-limit report 📦

Path Size
UMD 111.58 KB (-0.14% 🔽)
Auto 118.36 KB (+0.09% 🔺)
ESM - Core 23.73 KB (+0.12% 🔺)
ESM - Core + Card 63.53 KB (+0.1% 🔺)
ESM - Core + Dropin with Card 68.25 KB (-0.17% 🔽)

@sponglord sponglord marked this pull request as ready for review August 22, 2025 09:42
Copy link

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