#riptired-issuing-go

1 messages · Page 1 of 1 (latest)

fallen robinBOT
river lichen
signal yarrow
#

in my imports at the top, but if I try to do stripe.IssuingCardParams, I get an error from go that says IssuingCardParams is not a type

river lichen
signal yarrow
#

yes

#

this is a problem with importing, not related to actually having access to using issuing

#

Like what do I need to import in order to use this snippet from the docs
stripe.Key = ""

params := &stripe.IssuingCardParams{
Cardholder: stripe.String(""),
Currency: stripe.String(string(stripe.CurrencyUSD)),
Type: stripe.String("virtual"),
}
c, _ := card.New(params)

river lichen
#

Are you passing your test API key when you make this request?

signal yarrow
#

this is unrelated to authenticating

#

i am just getting these warnings as compilation errors

river lichen
#

So are you good now?

signal yarrow
#

No

#

stripeClient.IssuingCardParams is not a type

river lichen
#

Can you share where you're exactly seeing this error?

signal yarrow
#

yeah its just when I paste the code from the example

river lichen
#

I think there might be issue with the version of the library, further digging

signal yarrow
#

appreciate it

river lichen
signal yarrow
#

yeah let me try that

#

it says I need to go line by line and add these imports which doesn't seem to make sense, is that what I am supposed to do and is there a specific import for issuing

river lichen
#

Let me pull in a colleague who knows Go

signal stirrup
#

👋 Can you share your exact code including the exact imports you are using?

#

riptired-issuing-go

#

import "fmt"
import "github.com/stripe/stripe-go/v74"
import "github.com/stripe/stripe-go/v74/issuing/card"

func main() {
    stripe.Key = "sk_test_123"

        params := &stripe.IssuingCardParams{
            Cardholder: stripe.String("ich_123"),
            Currency: stripe.String(string(stripe.CurrencyUSD)),
            Type: stripe.String(string(stripe.IssuingCardholderTypeIndividual)),
        }
    ic, err := card.New(params)

    fmt.Printf("Got: \n", ic, err)
}``` this works for me for example
signal yarrow
#

hmm okay I was instantiating a stripe client

#

let me send the snippet

signal stirrup
#

@signal yarrow any luck?

signal yarrow
#

I removed the golang code because I couldn't get it to work -- I moved this into a python function instead

#

ill try this snippet next time I try stripe in go

#

thanks for your help 🫡