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

feature(3DS): Implement show method and return response with enriched nonce #2452

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

Conversation

siddy2181
Copy link
Contributor

@siddy2181 siddy2181 commented Nov 8, 2024

Description

The ThreeDomainSecureClient component provides a method to the merchant to display the 3DS challenge to the buyer if the response from the isEligible method is true. After the buyer has completed the 3DS challenge, the ilabilityShift, authenticationState, and anonce with enriched 3DS data will be returned to the merchant.

Code Sample:

const submitButton = document.getElementById("submit-button");

submitButton.addEventListener("click", async () => {
  if (isThreeDomainSecureEligible) {
    const {
      liabilityShift, // "no", "unknown", "possible"
      authenticationState, // "succeeded", "cancelled", "errored"
      nonce, //Enriched nonce or the original nonce
    } = await threeDomainSecureComponent.show();
    
    if (authenticationState === "succeeded") {
      // Check the liability shift and decide on continuing the transaction
    } else {
      // Cancelled or errored, merchant needs to decide what they want to check on
    }
  }
})

Why are we making these changes? Include references to any related Jira tasks or GitHub Issues

This PR covers the following tickets

DTPPCPSDK-2662
DTPPCPSDK-2665
DTPPCPSDK-2805
DTPPCPSDK-2855

❤️ Thank you!

@mchoun mchoun changed the title [test-only]Fastlane 3ds e2e feature(3DS): Implement show method and return response with enriched nonce Dec 6, 2024
@@ -94,6 +94,8 @@ module.exports = {
entry: "./src/shopper-insights/interface",
},
"three-domain-secure": {
globals,
automatic: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to automatic: true anymore, correct? I believe we were testing this when we were running into the zoid xprops issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe, having automatic: true wouldn't hurt. It would make this component available automatically when created. My understanding was that it will prevent collision with the old 3DS component.

Copy link
Contributor

Choose a reason for hiding this comment

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

automatic: true will return this component for everyone that loads the JS SDK. The exported setup() method is what will automatically create the zoid component when the component is loaded.

This will probably be fine for now since this component is still protected but we should remove this before we allow this in Production. If we don't, paypal.ThreeDomainSecureClient will be available to everyone even if they don't pass three-domain-secure into the components query param.

Copy link
Member

Choose a reason for hiding this comment

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

we should probably remove it now because even though its hidden, it will show up in all bundles served. I'm sure its super small but might as well not ship javascript if we don't have to

src/lib/security.js Outdated Show resolved Hide resolved
@siddy2181 siddy2181 dismissed a stale review December 11, 2024 00:12

Invalid review

@siddy2181 siddy2181 marked this pull request as ready for review December 12, 2024 18:21
@siddy2181 siddy2181 requested a review from a team as a code owner December 12, 2024 18:21
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.

5 participants