#nugax_invoice-email

1 messages · Page 1 of 1 (latest)

visual estuaryBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1233540359791968316

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

vagrant prismBOT
ripe mauve
#

HI!

#

I am simply trying to create a draft invoice with php. for send_invoice it says i need a customer_email, but customer_email is not a valid identifier according to the api response

old thicket
#

Hey @ripe mauve do you have more specific details? The request id you shared is unrelated and has a completely different error.
Our Create Invoice API https://docs.stripe.com/api/invoices/create does not have customer_email as a parameter anywhere though

ripe mauve
#

that doc does

old thicket
#

yeah that's the object though, that's the response from our API

ripe mauve
#

hmm

#

//Create Draft Invoice
$invoice = $stripe->invoices->create([
'customer' => $stripe_customer_id,
'auto_advance' => false,
'description' => $invoice_desc,
'collection_method' => 'send_invoice',
//'billing' => 'send_invoice',
'days_until_due' => $days_until_due_given,

]);

old thicket
#

what's the problem? Like what exact error do you get?

ripe mauve
#

getting it one sec

#

Stripe Error: Missing email. In order to create invoices that are sent to the customer, the customer must have a valid email.

#

does this mean in the customer object? not the invoice?

#

thats what im starting to think

#

This is my customer creation

#

//Create The Customer
$cust_obj = $stripe->customers->create([
'name' => $customer_name,
'description' => $customer_description,
'email' => $customer_email,
'phone' => $customer_phone,
]);

old thicket
#

ah yes you need to make sure your Customer has an email address since you use send_invoice which will force an email to them

ripe mauve
#

is there a way in customer account to set to not auto send invoices?

#

like billing or something? and i fixed that in my code. works now

old thicket
#

don't use collection_method: 'send_invoice' if you don't want to send an email

#

nugax_invoice-email

ripe mauve
#

but then i cant set the date

#

for due date

visual estuaryBOT
old thicket
#

correct, it doesn't really make sense to have a due date in that case, it'd be charged immediately

ripe mauve
#

I see. I'm trying to have stripe create an invoice though my app I'm dev then allow the user to post payment

#

But I wanted to keep up with due datw

#

Date

wooden harness
#

Hello! I'm taking over and catching up...

ripe mauve
#

I didn't want to automate stripe to collect . Do you have an exampl3 you can send me of what a invoice from stripe would look like? Maybe i do set auto collection.

#

Hi rubes! Been a while!

#

Rubeus.

wooden harness
#

To clarify, you want to create an Invoice with a due date but not have it sent to a Customer to collect payment?

ripe mauve
#

Yea I wanted the user of my app to initiate payment. But I think auto payment on date might work too

#

Now that I'm thinking about it.

#

I'd really just like to see what the customer would see from stripe.

wooden harness
#

You want to see it yourself, or you want to provide like a preview to your customer?

ripe mauve
#

I'm still learning the api so appreciate the help ND patience

#

I just want to see what stripes gonna send. Like a copy of a payment request or something

wooden harness
#

Is this just while you're testing, or is this something you want to do in production?

ripe mauve
#

This is testing rn. Eventually production

wooden harness
#

It would help me if I understood more about what you're building at a high level. What's the desired customer/payment flow?

ripe mauve
#

OK, so two types of payments.

#

Invoices with invoice items , tax rate, that are created at various times for merchandise or service sold

#

And subscription service that is recurring invoice

#

I should say two types of invoices and payments

#

I am working on the invoice portion now. I want to create an invoice with items and taxes that had a due date which a customer can pay whenever

wooden harness
#

Okay, so you want the customer to be able to pay the Invoice any time before the due date, including right now, correct?

ripe mauve
#

I have the api creating the invoice with a due date, tax rates, and correct due date

#

Yes! And autonpay on due date is fine.

#

Autopay or stripe autocharge

wooden harness
#

We don't really support automatically paying for an Invoice in the future like you're describing. Your choices when creating an Invoice are to set collection_method to either charge_automatically (where we attempt to charge them when the Invoice is ready to go) or send_invoice (where you send the Invoice to the Customer and they have until the due date to pay it).

#

It sounds like you want to go with send_invoice, but you need to have a Customer with an email to send the Invoice to for that to work.

ripe mauve
#

But couldn't I do a payment at any time on that invoice if I set it that way?

#

Say I create an invoice send invoice due in 30 days. They can pay anytime via the email, but I can using api create a method for it to be paid from my application

#

Correct?

#

Paid at anytime prior to the 30 days

wooden harness
#

Not sure I fully understand this part: "but I can using api create a method for it to be paid from my application". Can you clarify?

#

Do you mean can you have them pay the Invoice from your system after you create it and send it to them?

ripe mauve
#

Yes

#

I create a routine that using the api to collect payment

wooden harness
#

Yeah, you can do that. The Invoice will generate a Payment Intent, can you can build a payment form on your site that will confirm (pay) that Payment Intent.

#

What specifically did you want to happen in your system? Do you want to build a payment form with the Payment Element, for example?

ripe mauve
#

I'll probably just build it from the api. Haven't gotten that far yet

#

I can build my own form to match the system.

#

Do you happen to have a email you can send that shows what stripe sends for the invoice?

#

So I can see what stripe will send my customers

wooden harness
#

The easiest way to see that is to create an Invoice in the Dashboard in test mode and send it to yourself (use the same email address you use to log in to the Dashboard).

ripe mauve
#

OK.

wooden harness
ripe mauve
#

Yea I been using the dev api keys

#

I can set my app to test or liv3 and change the keys which are stored

wooden harness
#

Note that this is a public server, not sure if you want all of the information in that screenshot public.

ripe mauve
#

It's fine

#

I'll regenerate it

#

That's all bogus info

#

That's the form I'm working on that adds invoice items. At this point it's generated a draft invoice

wooden harness
#

You really shouldn't share your API key like that.

ripe mauve
#

You can just recreate a test key right

wooden harness
#

Yeah, you can roll it.

#

And get a new one.

#

Which I recommend you do.

ripe mauve
#

That's all it is

#

I will do

#

I just wanted to show what It was doing

#

I just wasn't sure what happens after I finalize the invocie

#

Invoice

#

From draft

wooden harness
ripe mauve
#

Cool. I'll read it. You have been very helpful - as usual. Thank you! I'll msg in if I have other issues. Appreciate it!

wooden harness
#

Happy to help! Good luck with your project!

ripe mauve
#

Thank-you! Oh one last question

#

The percentage fee for stripe is 2.9 + 30ceny

#

Cents

#

Right?

#

The cc processing fee

wooden harness
ripe mauve
#

OK. Ty. Have a great weekend