#Jonas Reif
1 messages ยท Page 1 of 1 (latest)
At the moment we listen to the charge_refunded webhook.
There we get the amount_refunded (e.g. 10000 for the 100โฌ)
But I need to find a way to get the "new" payed tax
Hm you may have to do a manual calculation to get that
Can you share an invoice id where you issued a credit note though so I can take a look?
in_1NIblnAHqm7DWpwQze6PnaDh
thats visible in the stripe dashboard
so basically I need the
- adjusted_total (in that example 248โฌ)
- and the adjusted_tax (55.56 - 15.96 --> 39,6)
You can get it from the credit note
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
But you'll need to do the subtraction yourself
In the charge.refunded webhook is there also a way to get the credit note id somehow?
Ok I get list all credit_notes by adding the invoice as parameter
Stripe::CreditNote.list(invoice: charge[:invoice])
And then I could iterate over it.
But I cant imagine that this is the only place where I could find that adjusted tax
Sorry, what do you mean?
You need to get this from the credit note object
what do you mean by "this"?
HI ๐
I'm stepping in as @elfin saddle needs to go soon. By "this" my colleague means the amount you should refund will be present in the credit note
The data you were asking for @rose ruin
But you need to do the subtraction yourself
Yes I get the tax from the credit_notes.
But when I listen to the charge.refunded webhook I have to first retrieve all credit_notes of that invoice by searching for all credit_notes of that invoice
Well you could just listen to credit_note.created also
Yes that would be also possible. But I dont see any advantage.
If you have 2 credit notes for an invoice (what could happen) then you have to fetch the invoice (to get the total amount) + search again for all other credit_notes of that invoice to get the total_refunded amount and calculate the tax
ok thanks ๐
I'll try that