braintree/braintree-web

ThreeDSecure missing types

Closed this issue · 1 comments

General information

  • SDK version: 3.88.0
  • Environment: Sandbox and Production
  • Browser and OS Chrome Version 127.0.6533.89 on MacOS 14.4.1

Issue description

We recently integrated braintree-web's ThreeDSecure (TypeScript version) into our checkout process and encountered an issue where certain interfaces do not include all the properties present in the corresponding data structures.

For example, in the lookup-complete callback, we receive data: ThreeDSecureVerificationData, where we need to access data.paymentMethod.threeDSecureInfo.status. However, TypeScript raises an error because the status property does not exist on the ThreeDSecureInfo type.

To resolve this, we extended the ThreeDSecureInfo interface to include the status property. While this workaround solves the issue temporarily, it is not an ideal long-term solution.

It would be highly beneficial if the types/interfaces were updated to reflect the complete structure, including the status property. Additionally, it would be helpful to expose enums such as ThreeDSecureEvent (among others) to improve clarity and consistency:

export enum ThreeDSecureEvent {
    LOOKUP_COMPLETE = 'lookup-complete',
    CUSTOMER_CANCELED = 'customer-canceled',
    AUTHENTICATION_IFRAME_AVAILABLE = 'authentication-iframe-available',
    AUTHENTICATION_MODAL_RENDER = 'authentication-modal-render',
    AUTHENTICATION_MODAL_CLOSE = 'authentication-modal-close'
}

Hi there! We can't speak to the typescript library wrapper for braintree-web, as we don't own that, and unfortunately don't have one of our own. We encourage you to submit a PR against that library for changes, or raise the issue with them. Apologies I cannot be of more assistance.