#tcy-invoice

1 messages · Page 1 of 1 (latest)

sharp parrot
#

it's just how the dashboard shows things

#

it's a 365eur invoice ,that much was due, and you marked it being as paid outside of Stripe, so there is no amount_paid since there was no payment inside Stripe for it

arctic wolf
#

In fact, it's somebody from the accounting service who dealt with this invoice, but I can't figure out what she did. I can see in the events, that a payment was created, and then canceled. But the "canceled" event shows "paid: true", and I don't understand why. Is there a way to know what triggered the "paid" event and why it says "paid" while being shown as "canceled"?
paid event: https://dashboard.stripe.com/events/evt_1J7Ef3AMPa07T75kY6WgtSkn
details: https://dashboard.stripe.com/logs/req_6rViLNXuJxSk3i

sharp parrot
#

there was no actual payment

#

when an invoice is created, a PaymentIntent is created since that's what you would use to process the payment

#

you can go in and mark the invoice manually paid which is what happened here

#

since the invoice is now closed, we delete the PaymentIntent since you won't be using it

#

so the PaymentIntent is status:cancelled and the Invoice is status:paid, this is normal and how marking the invoice manually paid like that works

arctic wolf
#

Ok. And there will never be a paid amount on the invoice in this case? It will always stay 0?

sharp parrot
#

yes, amount_paid is only set if there's a money movement inside Stripe

arctic wolf
#

Ok. May I ask you another question then?

sharp parrot
#

of course!

arctic wolf
#

I think I've got the solution, but I prefer to confirm it before I implement it :p
So here we go!
For now, we have something that displays to our customers, what they paid for their current subscription.
To achieve this, we get all the "paid" invoices related to this subscription, and return the sum of "amount paid".
Since invoices marked manually as paid have an "amount paid" equal to 0, I guess we should use the "amount due" instead of "amount paid" in these cases.
Do you confirm? Or do you think of an other way?

#

tldr: we should sum "amount paid" of "stripe payment related" invoices and "amound due" for "manually marked as paid" invoices

sharp parrot
#

I would special case the marked as paid ones yes, since the API is not very consistent here

#

i.e. the ones that have closed_for: "marked_paid" set on them

arctic wolf
#

Ok, I did not know about this indicator. Thanks for the tip!

#

I'll work on this, than you very much for the help 👍