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

Interface ICheckoutLineItems does not match the returned API #733

Closed
ddehghan opened this issue Dec 2, 2019 · 1 comment
Closed

Interface ICheckoutLineItems does not match the returned API #733

ddehghan opened this issue Dec 2, 2019 · 1 comment

Comments

@ddehghan
Copy link

ddehghan commented Dec 2, 2019

The type definitions for checkout line item is wrong :

in file: node_modules/@types/stripe/index.d.ts

interface ICheckoutLineItems {
                /**
                 * Amount to be collected per unit of item
                 */
                amount: number;

                /**
                 * Currency to collect payment in
                 */
                currency: string;

                /**
                 * The name of the item
                 */
                name: string;

                /**
                 * The amount of item being purchased
                 */
                quantity: number;

                /**
                 * An optional description for the item
                 */
                description?: string;

                /**
                 * A list of images for the item
                 */
                images?: string[];
            }

but data returned by stripe.checkout.sessions.retrieve(sessionId) is:

"display_items": [
    {
      "amount": 1500,
      "currency": "usd",
      "custom": {
        "description": "Comfortable cotton t-shirt",
        "images": null,
        "name": "T-shirt"
      },
      "quantity": 2,
      "type": "custom"
    }
  ],
@remi-stripe
Copy link
Contributor

@ddehghan Thanks for reporting! We don't have Typescript definitions for stripe-node today so you must be using a third-party library like DefinitelyTyped. You would need to work with them on a fix instead.

We're actively working on Typescript definitions this quarter though and are planning a beta soon! If you're interested, I'd recommend following the related issue here: #296

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants