#jarrett-invoices

1 messages · Page 1 of 1 (latest)

ruby basalt
ruby basalt
weary furnace
#

But how do I use payment intents with a draft invoice.

#

additionally, there are less available options for using setup intents with an invoice. all the available payment methods aren’t available.

white smelt
#

Can you describe what you are doing a bit more? Why are you doing Checkout on an Invoice's PaymentIntent?

jovial gazelle
#

@weary furnace why exactly are you using invoices for this? Why not just create the payment intents directly if you aren't actually using the invoices?

keen epoch
#

@weary furnace Opened your thread again!

weary furnace
#

ty @keen epoch. @white smelt I'll give you the flow. A user chooses an amount of credits to purchase in our system. We make a draft invoice that we then use on the next page and display the full breakdown of their purchase, use stripe coupons on their invoice etc. Right now, we currently make a setup intent and then pay that invoice. @jovial gazelle we use coupons and stuff so we are using features of invoices.

keen epoch
#

There isn't really a clear solution for you other than to switch to something like Checkout, which does support coupons. As you already know, Invoices won't generate a Payment Intent until they've been finalized. Once thye've been finalized you also can't delete them - you can only mark them as void.

weary furnace
#

that seems really lame. i don't get why there is no way to delete a finalized invoice. is it unreasonable to void tons of invoices?

#

like every "checkout" is a finalized invoice

keen epoch
#

The way you're using Invoices is not really their intended use cases - finalizing an Invoice usually that you fully expect the customer to complete/pay for it. This is why we usually recommend plain old payment intents for checkout flows where the user can abandon the cart

weary furnace
#

so how do invoices get used normally with coupons?

#

how does stripe checkout work? does it generate invoices?

jovial gazelle
#

hello! just catching back up

jovial gazelle
#

Stripe Checkout generates invoices for subscriptions, but not one-time payments

#

I asked earlier why you chose to use Invoices in the first place, instead of using Payment Intents directly

#

Is it primarily for the coupons/discounts?

#

If so, as Karbi mentioned Checkout supports those (user-enterable promo codes!) and presents a nice UI of the line items you send. For one time payments it will produce a receipt, not an invoice. Do you actually need the invoice for some reason?

weary furnace
#

we accept payment from other sources (ex PayPal) and mark the invoices paid out of band

#

this allows us to use Stripe as our source of truth for payments

#

and still utilize all the functionality without building out our own handling for coupons

jovial gazelle
#

Ok, well, that's fine but a consequence is having some void invoices. You can't delete these because they are legal documents in many jurisdictions. You void them to indicate they are no longer due.

#

Once you create a payment intent you'd have an analogous situation: you can delete them, you cancel them, to indicate they wont be completed.

#

Similar to checkout sessions

#

There isn't anything wrong with these incomplete payments, you just ignore them

#

If you want to avoid the void invoices, you'll need to defer creating invoices until later in your payment flow when youre more confident that customer will pay

#

You'll still have some, of course, but ideally fewer

weary furnace
#

i just don't get why there is no way to associate an invoice with a payment intent during creation

#

like you need a payment intent to use the payment element

jovial gazelle
#

what do you mean?

weary furnace
#

but there is no way to get one without finalizing an invoice

#

i don't know if a customer's credit card will fail at this point.

jovial gazelle
#

well yea, because a draft invoice is a draft, its not expected to be paid, so there is no payment

weary furnace
#

but why is there no way to create a payment intent FOR an invoice

jovial gazelle
#

Whether a customers payment method fails or not shouldn't determinw whether you issue an invoice for them, an invoice indicated someone owes you money for something, then you collect on it

#

That's created for you when you finalize. The way you're using Invoices is misaligned with their intended use, so it doesnt support your use case / flow

weary furnace
#

does Stripe checkout generate invoices?

jovial gazelle
#

It sounds like what you really want is payment intents, and you can manage the coupon/discount flow in your own application, and set the amount however you like

#

For subscriptions, yes, not for one-time payments

weary furnace
#

ok and how does it work if i don't start my subscription cause I don't pay

#

it just voids the invoice?

#

the reason we use invoices too is so we can provide customers with custom orders

jovial gazelle
#

Yes, if a subscription is created without payment (incomplete) and abandoned, it would eventually become incomplete_expired and the associated first invoice would be void

#

Whats stopping you from offering custom orders using payment intents directly?

weary furnace
#

well this checkout process is used in various ways where invoices do make a lot of sense. for example we have an enterprise customer that we need to send an invoice to. this flow handles that

#

so switching to payment intents would mean we'd have to have an entirely separate flow to handle other stuff like that which would not be nearly as clean.

#

what are the negatives to voiding invoices that never are paid

weary furnace
#

also, it just seems odd that you can't collect a payment via a payment intent and apply it to an invoice.

errant sleet
#

yeah that isn't supported right now

weary furnace
#

"right now"... is this something that will be?

errant sleet
#

i.e. we have heard that feedback from users but nothing has been built around that

weary furnace
#

gotcha, but the invoice voiding strategy, is there any negative side affects to that?

#

besides a customer just having a bunch of voided invoices for checkouts they never completed