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

Missing types for confirming "card" payment intents #1285

Open
Borales opened this issue Nov 4, 2021 · 3 comments
Open

Missing types for confirming "card" payment intents #1285

Borales opened this issue Nov 4, 2021 · 3 comments
Assignees
Labels
future type definition Marks issue related to outdated or incorrect TypeScript type definition

Comments

@Borales
Copy link

Borales commented Nov 4, 2021

We have been using this package for a long time, but we noticed that some Typescript types are missing, more specifically - confirming the "card" payment intents by following this manual.

Stripe version: 8.186.0
Typescript version: 4.3.5

payment_method_data.type doesn't accept card as a valid value, and Typescript compilation fails. Up until this point we were using @ts-ignore comment to skip this call from TS errors, but I'm afraid it may ignore some upcoming changes that we need to be aware of.

Screenshot 2021-11-04 at 13 07 56

@remi-stripe
Copy link
Contributor

@Borales Today we don't have types for card payments as this hash can also take raw card details (like number and CVC) which is strongly discouraged as it has PCI implications (see doc). It agree it'd be helpful to support passing those masterpass details and other related parameters though so we might do this in the future. Tagging as future and assigning to @richardm-stripe to look into this

@Borales
Copy link
Author

Borales commented Nov 4, 2021

@remi-stripe is it an experimental payment method or something?

You could still add types for Card type with the cart_id and transaction_id (omitting the variant with the raw card details), since the described snippet is in the official documentation, the API can handle these requests, so it's just the package itself that blocks the usage of it (well, mostly breaks the TS checks).

@remi-stripe
Copy link
Contributor

You could still add types for Card type with the cart_id and transaction_id (omitting the variant with the raw card details)

We could and should! It's just a bit more complex than it appears to be from the outside and so for now we've defaulted to no types for the card hash just yet. We definitely need to improve this but it's not a higher priority compared to a lot of new core features we're working on as it doesn't block any integration from using this. You can disable type signature for that one case.
The API is stable and you can use it without worry about this changing, it's just a legacy limitation we haven't gotten around to fix just yet in the Typescript definitions.

@kamil-stripe kamil-stripe added the type definition Marks issue related to outdated or incorrect TypeScript type definition label Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future type definition Marks issue related to outdated or incorrect TypeScript type definition
Projects
None yet
Development

No branches or pull requests

4 participants