#wrld-go
1 messages · Page 1 of 1 (latest)
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
I think it's more of a Go grammar thing
is this how you would go about sending an invoice?
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
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
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
Gotcha
To Create an Invoice, you will need to create an Invoice Item first 😅
I found and end-to-end Doc for you
This one works too: https://stripe.com/docs/invoicing/integration