#wrld-invoice-help

1 messages · Page 1 of 1 (latest)

icy bison
#

Hi! How can we help?

loud garnet
#

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?

icy bison
#

Hmmmm....

#

Do you have the Invoice ID or Request ID for the Invoice that is being generated via this code?

loud garnet
#

I do have it

icy bison
#

Can you post it here so I can take a look?

loud garnet
#

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?

icy bison
#

I'm taking a look now

loud garnet
#

oh ok

#

im just confused as to why it isnt generating an email being sent to the person

icy bison
#

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

loud garnet
#

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

icy bison
#

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?

loud garnet
#

I have not, let me see how to do that

#

am a little lost doing this

icy bison
#

Where are you lost at?

loud garnet
#

I am trying to make it so it is due in 5 mins

sullen panther
#

why?

#

like what is the point of sending an invoice due in minutes, that doesn't really make sense

loud garnet
#

so I can see if the invoice will send

#

Its time sensitive for what i am working on

sullen panther
#

Create an invoice, finalize it, then it will send

loud garnet
#

I did in the code above

#

It did not send an email

sullen panther
#

The only thing I see above is one request id from go for invoice creation.

loud garnet
#
            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)

}```
sullen panther
#

the Invoice you mentioned above has never been finalized though

#

Are you testing on another one? Something else?

loud garnet
#

I switched product in invoice item params thats all

sullen panther
#

Can you share the exact invoice id you have finalized that didn't send an email?

loud garnet
#

I will send the one i just did

#

This is from what i just done

sullen panther
#

thx looking

loud garnet
#

np

#

ty

loud garnet
#

anything?

sullen panther
#

yeah I think you have to call the Send Invoice API after that to trigger the email

loud garnet
#

Okay and is that in docs?

sullen panther
loud garnet
#

see something one sec

#

All done

#

I just needed to call the apu

#

api like you said

#

Thank you koopah ❤️

#

koopjah troopa