#Linas

1 messages ยท Page 1 of 1 (latest)

late finchBOT
light plover
#

How are you trying to edit the invoice? Via the API?

tropic lichen
#

yes

light plover
tropic lichen
#

thank you. Maybe there is more simple solution? In general i'm finalizing invoice only, that i could get client secret via PaymentIntent. But maybe there is more simple solition to get client secret ?

#

maybe i don't need to finalizei nvoice ?

light plover
#

You'll only get a Payment Intent (and its client_secret) once the Invoice is finalised

#

There's no other way to amend/change a finalised invoice

tropic lichen
#

And there is no other way to get client secret?

light plover
#

With invoicing? No

tropic lichen
#

got it, thank you.

#

and one more question:

#

now, when user lands on page, system automatically creates customer, invoices and so on... so there will be a lot of empty/unpaid users on stripe.

#

Is that a normal practice?

light plover
#

Why specifically are you using invoices?

tropic lichen
#

because i want to list products with separate prices.

#

so i create invoice and add invoice items to it.

#

on payment form we have a bump offer. If user clicks on it, we need to add additional item to invoice. If user unclicks it, we need to remove that additional item from invoice.

light plover
#

Then just don't finalise the invoice until they reach the final step of your checkout. That will prevent the need for the amendments

tropic lichen
#

But if i don't finalize, how i would get client secret from backend ?

light plover
#

You only need the client_secret once they're ready to pay though. So you just delay the finalisation until they're at the last step

#

Really, your use case for invoicing isn't very traditional. They're not meant to be used in a checkout flow like this

tropic lichen
#

but client secret is used to generate apple pay button, no ?

#

my backend part looks like this. Not sure if you are familiar with php.

light plover
#

My point is, you need to adjust your checkout flow to only finalise once any/all changes have been made the the order/invoice. That will significantly reduce the code burden on your integration

#

But as I stated, the invoicing API/product isn't really meant for this usage which is why you're running up against issues like this

tropic lichen
#

Ok, but i cannot avoid invoicing, because i need to list products as separate items? Right ?

light plover
#

I don't know what what means. What specifically do you require from that?

#

Are you using it as a way to display a cart?

tropic lichen
#

I need to have that data (that user bought two items) on webhooks, that i could fulfill the order. At first i was following classic stripe ApplePay example, which is ok, when you are selling single product.

#

Also if user requests for refund on one item, that i could issue refund for that one item.

#

thats why i have choosen Invoicing..

light plover
tropic lichen
#

but then user is paying on stripe website, right ?

light plover
#

Correct, but it handles all of your requirements for you

tropic lichen
#

my boss wont agree on this.

light plover
#

Otherwise there isn't really a Stripe API that handles the order functionality that you're describing

#

You'll likely want to leverage a third-party service for some cart/order functionality, otherwise you'll continue to come against issues with the Invoicing API

tropic lichen
#

what issues you have in mind ?

#

i guess, i could also delete finalized invoice and if user adds item to invoice, i could create new one with items, right ?

light plover
light plover
#

My suggestion would be to create or use a third-party order system and leverage Stripe for payments

tropic lichen
#

So, there is two solutions:

#
  1. Use stripe checkout, which happens on stripe page 2) USE revise invoice (which is not recomended) 3) Void invoice and recreate (also not recomended)
languid elk
#

Hello ๐Ÿ‘‹
Taking over as ynnoj needs to step away

So, there is two solutions:

  1. Use stripe checkout, which happens on stripe page 2) USE revise invoice (which is not recomended) 3) Void invoice and recreate (also not recomended)
    yes
tropic lichen
#

ok, let me a bit explore documentation..