#wrld-invoice-help
1 messages · Page 1 of 1 (latest)
Hey!
Am not recieving invoice email when attempting to send an email
Customer: stripe.String(createCus.ID),
Price: stripe.String("price_1LQcoSD6yTzA8Nx6TCGJOS2p"),
}
createInvItm, err := invoiceitem.New(&createInvParams)
if err != nil {
fmt.Println("Unable to make invoice item.")
}
fmt.Println("Made invoice item.", createInvItm)
createInvoiceN := &stripe.InvoiceParams{
Customer: &createCus.ID,
CollectionMethod: stripe.String("send_invoice"),
DaysUntilDue: stripe.Int64(1.0),
}
in, _ := invoice.New(createInvoiceN)
if in.ID != "" {
fmt.Println("Sent Invoice")
}
sendParam := &stripe.InvoiceFinalizeParams{
}
result, _ := invoice.FinalizeInvoice(in.ID, sendParam);
fmt.Println("Finalized invoice.", result.AmountRemaining)
}```
I am not receiving then email asking to pay?
Hmmmm....
Do you have the Invoice ID or Request ID for the Invoice that is being generated via this code?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
I do have it
Can you post it here so I can take a look?
sure
Status
200 OK
ID
req_sFycWrpre9APcT
Time
7/28/22, 7:10:43 PM
IP address
71.206.194.97
API version
2020-08-27
Latest
Source
Stripe/v1 GoBindings/72.122.0
Idempotency
Key — 1659049843474689000_ZKU0Ng
Post /v1/invoices
what?
I'm taking a look now
oh ok
im just confused as to why it isnt generating an email being sent to the person
I don't think it sends the invoice until it is due. So this invoice in_1LQfqqD6yTzA8Nx6LCkqjcpS was created today with days_until_due: "1", so I believe this actually won't send an email until tomorrow.
You can force the Invoice to be sent via the Dashboard or with send_invoice: https://stripe.com/docs/api/invoices/send
is there any way i can test it to make it due now?
or 5 minutes after recieving?
I did force it with send_invoice in code
I believe due_date can be modified to any time in the future. Have you tried passing in a Unix timestamp set for 5 minutes from creation?
Where are you lost at?
I am trying to make it so it is due in 5 mins
why?
like what is the point of sending an invoice due in minutes, that doesn't really make sense
Create an invoice, finalize it, then it will send
The only thing I see above is one request id from go for invoice creation.
Customer: stripe.String(createCus.ID),
Price: stripe.String("price_1LQgNSD6yTzA8Nx6fCo7Epw4"),
}
createInvItm, err := invoiceitem.New(&createInvParams)
if err != nil {
fmt.Println("Unable to make invoice item.")
}
fmt.Println("Made invoice item.", createInvItm)
createInvoiceN := &stripe.InvoiceParams{
Customer: &createCus.ID,
CollectionMethod: stripe.String("send_invoice"),
DueDate:
//DueDate: ,
}
in, _ := invoice.New(createInvoiceN)
if in.ID != "" {
fmt.Println("Sent Invoice")
}
sendParam := &stripe.InvoiceFinalizeParams{
}
result, _ := invoice.FinalizeInvoice(in.ID, sendParam);
fmt.Println("Finalized invoice.", result.AmountRemaining)
}```
the Invoice you mentioned above has never been finalized though
Are you testing on another one? Something else?
I switched product in invoice item params thats all
Can you share the exact invoice id you have finalized that didn't send an email?
thx looking
anything?
yeah I think you have to call the Send Invoice API after that to trigger the email
Okay and is that in docs?