#price-go

1 messages · Page 1 of 1 (latest)

thorny oak
#

@true falcon are you on a recent enough version of stripe-go?

true falcon
#

I'm on 72

thorny oak
#

are you sure you're on 72?

true falcon
thorny oak
#

is this the first time you use stripe-go? Or does another part of your code use it successfully? because it should be price.New (lower case) and after having loading the price package properly

true falcon
#

I was getting errors from it earlier.

#

So it is definitely working.

#

I'm creating the price object to resolve those errors.

#

I just keep getting undefined price.

#

If I comment out the section where I create a price object, I get an no such price error when I attempt to create a stripe checkout.

thorny oak
#

Can you share your entire code (except your API key)

#

I think you're not including the package(s) properly

true falcon
#

Yup, fair enough.

thorny oak
#

my guess is that you have a variable called price and that overrides the package and so it doesn't work but hard to say without seeing your code

true falcon
#

I had a look, and I can't see anything that would override the package.

thorny oak
#
    "github.com/stripe/stripe-go/v72/checkout/session"```
#

you did this but never included the price package right?

#

"github.com/stripe/stripe-go/v72/price"

#

so you just need this too

true falcon
#

_<

#

Sorry for wasting your time, thank you!

thorny oak
#

the joy of go :p

#

it's all good, I've done that myself many times

#

it's either that or you do price := "my price" and then price.New doesn't work anymore

#

which I have lost countless hours on so I'll never forget this I think

#

thanks for sharing the code quickly that helps narrow things down 🙂

true falcon
#

Thank you for all the help!