#wrld-go

1 messages · Page 1 of 1 (latest)

autumn marlin
#

Hi, sure, can you elaborate on the question?

rustic flare
#

Hey I didnt even know you can do this

#

Anyways, I am new to stripe api as a client wants it integrated into their system.

#

I am trying to make it so it sends an invoice to the user

#

Should I utilize this : params := &stripe.InvoiceParams{}

#

then how would i initiate sending it?

#

If i use example send, _ := invoice.SendInvoice(params)

#

then I would get this error on params

#

cannot use params (variable of type *"github.com/stripe/stripe-go/v72".InvoiceParams) as *"github.com/stripe/stripe-go".InvoiceSendParams value in argument to invoice.SendInvoice

autumn marlin
#

I think it's more of a Go grammar thing

rustic flare
#

is this how you would go about sending an invoice?

autumn marlin
#

Um the official Doc passes it directly

in, _ := invoice.SendInvoice(
  "in_1LQNXgEmaib10qkRqUbuNmcr",
  nil,
)

I haven't tried the pattern you say, but it should be possible as other languages is possible

rustic flare
#

So basically, made a form and when they fill it out ( Email, product choice) and they click submit, it automatically sends them an invoice of that amount to there email.

#

I read that from the docs. Does it generate an ID? like what am I even passing in as in_1LQNXgEmaib10qkRqUbuNmcr

#

basically generate and send them an invoice is what I want to do

autumn marlin
#

You will need to create an Invoice first, then send it. The API above is the 2nd part

#

in_xxx is an Invoice Id, which you can have after you created it

rustic flare
#

Gotcha

autumn marlin
#

To Create an Invoice, you will need to create an Invoice Item first 😅

#

I found and end-to-end Doc for you

rustic flare
#

thank you

#

so much

autumn marlin
rustic flare
#

I am looking over them now i never seen this part of ur website before

#

you're the man

#

i should be good going off these docs

#

thank you so much