stripe / stripe-js

Loading wrapper for Stripe.js
https://stripe.com/docs/js
MIT License
636 stars 157 forks source link

[BUG]: no type definition for stripe.createConfirmationToken #581

Closed tinleym closed 8 months ago

tinleym commented 8 months ago

What happened?

using: "@stripe/react-stripe-js": "^2.6.2" "@stripe/stripe-js": "^3.1.0"

Environment

No response

Reproduction

No response

brendanm-stripe commented 8 months ago

Can you clarify exactly what you're seeing and where? Types for Confirmation Tokens were added (here) prior to yesterday's 3.1.0 release so I would expect these to be included.

felixfung203 commented 8 months ago

@brendanm-stripe Does stripe.createConfirmationToken() support CardElement ? For example:

const result = await stripe.createConfirmationToken({
            type: 'card',
            card: cardElement,
            billing_details: {
                name: 'test'
            }
        });
tinleym commented 8 months ago

Ah, my editor was linking to an old type definition file after updating. Everything looks good!

brendanm-stripe commented 8 months ago

Great, thanks for confirming @tinleym !

@felixfung203 No, as the docs suggest this is only for Payment Element and Express Checkout Element.

elements REQUIRED The Elements instance that was used to create the Express Checkout Element or Payment Element.