#MarcusStripe-charge-amount-amount_captured

1 messages ยท Page 1 of 1 (latest)

real bough
#

Hello ๐Ÿ‘‹
Give me a moment to take a look

latent sage
#

@sick quiver The charge API has no tax information/support. It just shows the total amount that's it. amount is how much you charged/authorized and amount_captured is how much you really captured (you can partially capture an amount)

sick quiver
#

so amountCaptured is potentially more correct if I want to know the actual money being send?

#

So if the amount included tax, I will need to reverse remove that? ๐Ÿ˜ฆ

#

what if, I have a customer that moved location, and back then had to pay tax.. but not anymore or vice versa

latent sage
#

Let's take a step back: The Charges and PaymentIntents API do not handle/calculate/surface tax in any way. How are you calculating tax? Using a third-party or using Stripe Tax itself via Checkout/Billing?

sick quiver
#

for each of my customer, I track if they are EXEMPT, REVERSE_CHARGE or MANDATORY with tax

#

an I think I have created a tax object also in stripe of 19%

#

then when a customer buys a subscription, the tax will be added accordinglt, AFAIK

#

I need the raw amounts, as I will build a comission from those.. and the tax will be added based on the new receiver of the new total amount

latent sage
#

okay so you use Billing for recurring payments?

sick quiver
#

not sure what you mean. we have recurring paymenys (subscriptions). We create the invoices on our end using the invoice_paid event

#

I was using that for what I now want to use the charges for, earlier

#

but I want to switch... because I want to connect charges with any potential list of refunds

latent sage
#

I'm sorry, you're being a bit cryptic. I can't really help without knowing exactly what product(s) you use that we offer. If all you do is create charges for $100, then we have no tax information. But earlier you said you create a tax object of 19% in Stripe. That is unclear, but I assume you mean a TaxRate and that you create a Subscription in Stripe to automatically charge your customer every month

sick quiver
#

no

#

I do have subscriptions in stripe, and they are subscribed to, and then auto payed by recurring payments

#

I assume you mean a TaxRate and that you create a Subscription in Stripe to automatically charge your customer every month

#

correct.

latent sage
#

Okay so that's what I said. And you said "not sure what you mean" right after

sick quiver
#

you spoke of billing.. something something

#

anyway. now that we both know.. ๐Ÿ˜‰

#

So what i want to achieve is, a list of money paid without taxes, and attach a list of refunds to it,
So that i can build a total and calculate of commission of the total -
e.g. (20 + 20 + 30 + 100) *30%

#

The single amounts would be from different customers.

#

And the receiving party is another customer, my affiliate partner

#

and the partner might be paying tax or not.. independent of the source customers

#

I have done that with invoice_paid and credit_note.created, but then I had no relation from the refunds (negative amounts) to the positive amounts (charges).

#

--
Hm... But actually.. the stripe customer ID could be my connection also!

#

together with the invoice period, actually

#

==
so if you say, the only way to get the amount without tax is invoice_paid.. then probably I have to use it..
And.. credit_note.created, I think would also give me the amount with and without tax

latent sage
#

Yeah sorry the server is really busy right now and that's a lot of text ๐Ÿ˜…

#

but yes, you should list Invoices, and then for each Invoice you can look up everything you want: CreditNote, Charge, associated Refunds, etc.

#

I recommend reading our docs on our Expand feature: https://stripe.com/docs/expand it lets you retrieve an object (the Invoice) and expand related objects all in one request

sick quiver
#

well.. I dont think it work - like that as you wrote.

#

Because, the invoice comes any time.. and the refunds can arrive later

#

so I am currently thinking of maybe keep listenign to "credit_note.created" - there is:
stripeCreditNote.getNumber()
and that is, AFAIK - just "-CN-" plus the original invoice number

#

because, I just realized.. the customer id alone is nut sufficient.. because there are different periods.. I am collecting the amounts continously.
So I want to basically group all refunds that were incoming up to one month after the invoice was created, to the invoice id

#

then I could see for each customer, the original raw amount without tax paid, and below it a list of potential refunds within the following month, and get a total amount i received within this period / customer

latent sage
#

I mean yes you can't get everything right now today. Your code has to track all refunds, all credit notes, all failed payments and reconcile the information you need. You would use Webhooks https://stripe.com/docs/webhooks to listen to new information/Event sent, etc.

sick quiver
#

now you are confusing me. 1) Arent refunds part of credit notes. Whenever I want to create a refund, I do create a credit note.
Failed payments - then there would be no invoice paid event.

latent sage
#

Not all CreditNote will create refunds. And the vast majority of developers out there never use CreditNotes either

#

Sorry, it's not easy to help with so little information from you right now

#

But yes if you only ever use CreditNote for refunds then you would mostly look at Invoices and their CreditNotes

sick quiver
#

ok

#

yes I only ever do it in that way

little tusk
#

Hi ๐Ÿ‘‹

I'm stepping in. Give me a second to catch up

sick quiver
#

but I realized that, there might be a refund coming in at a later time also.. and it might occur that I would come to a negative total amount that way..
the money send to the other party is send using Stripe connect.
How do I RETRIEVE money from a stripe connect account? I Assume with charges? But I would probably have to activate that in the stripe board somehow? Does the customer have to accept to this also in some way when setting up their stripe connect account..
If its difficult / complex.. maybe I would just store such value as a DEBIT on my end and sum it up with following up credits in the next month?

little tusk
#

Okay so this is during a refund, correct? And you wish to retrieve the funds from a Connect account associated with a charge you are refunding?

sick quiver
#

no

#

ok dont worry.. I have enough food for thought.

#

I need to run away.. I will think about all and get back .. if neeeded