stripe-node icon indicating copy to clipboard operation
stripe-node copied to clipboard

Why is `url` nullable for Checkout Session object?

Open tyndria opened this issue 2 years ago • 1 comments

Describe the bug

Correct me if I'm wrong, I haven't found anything in the doc that says that url can be null.

Is it correct, that url is null in typings?

/**
 * The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you're using [Custom Domains](https://stripe.com/docs/payments/checkout/custom-domains), the URL will use your subdomain. Otherwise, it'll use `checkout.stripe.com.`
 */
 url: string | null;

#Why is statu

To Reproduce

See this file

Expected behavior

I expect it will be a string instead of string | null, but probably I misunderstood sth

Code snippets

No response

OS

macOs

Node version

Node v14.19.0

Library version

stripe-node v9.12.0

API version

2020-08-27

Additional context

No response

tyndria avatar Aug 25 '22 11:08 tyndria

Thanks for the report @tyndria - we're going to reach out to the product team and see if this is intentional and then get back to you!

dcr-stripe avatar Aug 26 '22 15:08 dcr-stripe

today i fall in that bug, when i hit stripe.checkout.sessions.retrieve , the url is comming null, so i dont know what to do yet.

EduGomes18 avatar Apr 27 '23 18:04 EduGomes18

The docstring for that property has been improved since this was open and now also says

This value is only present when the session is active.

When a Session is not active (completed, expired, canceled, etc.) the url property is null.

remi-stripe avatar Apr 29 '23 22:04 remi-stripe