question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handler Function Is Never Hit In initializeChallengeWithLookupResponse API

See original GitHub issue

General information

  • SDK version: 3.57.0
  • Environment: Production
  • Browser and OS: Chrome 84.0.4147.125 (64-bit) on MacOS 10.15.6 -->

Issue description

We are trying to customize iframe generated by initializeChallengeWithLookupResponse API

braintree.client
.create({ authorization: braintreeClientToken })
.then((newBraintreeClient) => {
  braintree.threeDSecure
    .create({
      client: newBraintreeClient,
      version: '2-inline-iframe',
      loggingEnabled: true,
    })
    .then((newThreeDSecureClient) => {
      newThreeDSecureClient.on(
        'authentication-iframe-available',
        (payload, next) => {
          console.log(JSON.stringify(payload));
          next();
        },
      );
      newThreeDSecureClient
        .initializeChallengeWithLookupResponse(lookupResponse)
        .then((payload, error) => {
          // ...
        })
        .catch((error) => {
          // ...
        });
    });
})

But the handler function in newThreeDSecureClient.on(‘authentication-iframe-available’, handler) is never triggered even though we can find authentication-iframe-available in events inside initializeChallengeWithLookupResponse. We never hit console.log(JSON.stringify(payload));. Is this a bug or the way we are using the APIs needs modification?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
crookedneighborcommented, Aug 18, 2020

Either open a support ticket at https://help.braintreepayments.com/ or reach out to your Braintree account manager. Be sure to reference this issue.

0reactions
crookedneighborcommented, Aug 28, 2020

Was able to go through your staging site. Looks like you created 2 three d secure instances, one using version: '2' and one using version: '2-inline-iframe'. Since version: '2' was created first, the global Cardinal object was configured to use the normal Cardinal modal, and the second call to configure the Cardinal SDK was ignored. (not by Braintree, it’s ignord by the Cardinal SDK).

You can fix this problem by either using a single 3D Secure instance or by instantiating both with version: '2-inline-iframe'.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js Error Handling Best Practices: Ship With Confidence
Want to ship your Node.js applications with confidence? Learn Node.js error handling best practices, tips and tricks with our simple guide.
Read more >
The 10 Most Common JavaScript Issues Developers Face
If you need help figuring out why your JavaScript isn't working, consult this list of the 10 most common JavaScript issues from a...
Read more >
ThreeDSecure (Braintree 3.12.0 API) - javadoc.io
Initialize a challenge from a server side lookup call. ... During lookup the original payment method nonce is consumed and a new one...
Read more >
Troubleshoot execution issues in Lambda - AWS Documentation
Errors can occur during function initialization, when your handler code processes the event, or when your function returns (or fails to return) a...
Read more >
REST API error codes - DocuSign Developers
In most cases, the response body contains a more detailed errorDetails structure when an error occurs. However, depending on the error, the server...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found