#Stripe: LineItems' PriceID not a valid field??

20 messages · Page 1 of 1 (latest)

fallow zealot
#

I am using stripe to (try to) process my payments. I am trying to make the checkout part work as a start, but I can't give my PriceID to my LineItemParams struct?

ornate ibex
unreal dove
#

With github.com/stripe/stripe-go/v76, that code looks fine to me. Which means either you're using a different version of the library to me, or your code is actually fine and your LSP is being shit

#

Try restarting VS code and see if the errors goes away

#

Try building your code on the command-line with go build ./... and see if you get the same (or similar) error

fallow zealot
#

Thank you!

unreal dove
#

Yeah, you need the major version suffix in there because that's how Go modules work 🙂

#

If you're ever unsure what to go get, just look at the very top of the go.mod file in the repo you're go getting

fallow zealot
unreal dove
#

Often times they'll even give you the latest go get command in the README

unreal dove
#

By default, if you don't include a major version suffix, it'll just get the latest version of that package without the major version suffix, which just so happens to be v70.15.0

#

It's a bit weird, but you'll get used to it

#

It's worth noting too that the major version suffix is only a requirement for packages with a major version >= 2. If a package is still v0 or v1, you don't need the major version suffix

#

Like I said though, just check out the go.mod for the repo if you're unsure.