stripe / stripe-node

Node.js library for the Stripe API.
https://stripe.com
MIT License
3.9k stars 756 forks source link

Stripe.checkout.session Type error #2099

Closed prathu9 closed 6 months ago

prathu9 commented 6 months ago

Describe the bug

Stripe.checkout.session type have shipping_details property but webhook request doesn't contain shipping_details, it has shipping property

To Reproduce

1) Add endpoint in webhook and select checkout.session.completed event 2) Create webhook api, construct stripe webhooks event, check for checkout.session.completed event 3) Store session in a variable called session, assert session variable type to Stripe.Checkout.Session 4) Try to access shipping property on that session object

Expected behavior

Stripe.Checkout.Session type should have shipping property instead shipping_details

image image

Code snippets

No response

OS

windows

Node version

v20.12.2

Library version

15.8.0 (latest)

API version

2024-04-10

Additional context

No response

remi-stripe commented 6 months ago

@prathu9 The shipping name was changed to shipping_details back in the API version 2022-08-01 and our types on stripe-node are correct and match the latest API version.

Your Stripe account is likely a few years old and has an old API version as the default. Events being sent to your WebhookEndpoint(s) will use that old API version unless you explicitly upgrade to the latest or force one in the API when you create the WebhookEndpoint.

Since this is more an integration support question, if you have follow up questions, please reach out to our support team for 1:1 help: https://support.stripe.com/contact or talk to our developers on Discord: https://stripe.com/go/developer-chat