Skip to content

Bug: Missing type definition for cardholderName #965

@chrism1996

Description

@chrism1996

Hello guys,, I found a bug which is quite annoying when we you use typescript, the type definition for cardholderName is missing. Example:


export const braintreeDropInConfig = ({
  braintreeClientToken,
  threeDSecure,
}: {
  braintreeClientToken: string;
  threeDSecure: Options['threeDSecure'];
}): Options => ({
  authorization: braintreeClientToken,
  container: '#dropin-container',
  threeDSecure: threeDSecure,
  card: {
    cardholderName: {
      required: true,
    },
    overrides: {
      fields: {
        // cardholderName is not in the types
        //@ts-expect-error - Braintree types are not updated.
        cardholderName: {
          placeholder: `Cardholder's name test`,
        },
        expirationDate: {
          placeholder: 'Expiry date (MM/YYYY)',
        },
        cvv: {
          placeholder: 'CVV',
        },
        number: {
          placeholder: 'Card number',
        },
      },
    },
  },
});

Braintree version: "braintree-web-drop-in": "^1.44.0".
The correct behaviour should be avoid adding @ts-expect-error .

Image

As we can see in the attached image, the cardholderName it works when it's provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions