#todordvv_api

1 messages ¡ Page 1 of 1 (latest)

night craneBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1229932456979988545

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

digital pollenBOT
carmine shore
#

So what is the point of even setting "application_fee_percent" to subscriptions when it does nothing when issuing invoices or making charges for that subscription? And how can I make sure to update invoices' "application_fee_amount" before charges happen when automatically charge credit card on record is selected when creating a subscription or invoice?

arctic maple
#

Hi there, sorry for the delay

carmine shore
#

No worries!

arctic maple
#

I was looking through the Event ID you shared and trying to put together a timeline

carmine shore
#

I can share more event IDs but the issue I am having is the events fire in the wrong order for some of these automatic charge collections and it all happens too quick - there's not enough time to edit the invoice before it's paid.

arctic maple
#

Are you hoping to use percentage or amount?

carmine shore
#

Ideally I would want to be able to set percentage and everything from there on-out to happen automatically.

#

The basic gist is that my clients went with stripe for their franchise, and they were assured they can automatically collect a % of every transaction that the connected accounts make.

#

But when it came down to it there's no such setting on the dashboard level that will auto collect application fees in a set percentage from all transactions by connected accounts.

arctic maple
#

The reason I ask is because I see the application_fee_amount value for this first invoice of this subscription was updated manually

carmine shore
#

Yes, I first tried to update the application_fee_percent for the subscription, based on the subscription.created hook

#

and that worked but the invoice that was created (when paid) didn't result in any application fees being charged

#

and the data for the invoice showed application_fee_amount = 0

#

so clearly setting the application fee percent on the subscription object did nothing

#

I even tried the forward time tool and any future invoices also didn't have application_fee_amount assigned

#

so then i hooked into invoice.created and set it up so that the application_fee_amount is set to the total value of the invoice * 17 / 100 - which is 17%

#

and that works now for any invoices that are set to be sent via email and manually paid.

#

but it does not work for subscriptions that are set to automatically charge the card on record, the invoice, payment intents and charge all are created and processed so quick that there's no time to update any and the webhook events are actually arriving out of order and/or too late

#

--

#

an alternative way that I read this can be done maybe is instead of updating the application fees is to charge the connected account a percent of every invoice.payment_succeeded

#

event

arctic maple
#

I'm looking through the events for this Subscription and tracing the Invoices that were created as the test clock was advanced

carmine shore
#

i think this might be a simpler and safer approach

#

just charge the account a % whenver an invoice is paid

#

question is which attribute to base the charge on - amount_paid or total. I guess the amount_paid would be best since it probably reflects whatever charge was made and what $$$ amount went into the balance

arctic maple
#

I'll flag this to our team as well. I'd expect the application_fee_amount on the second Invoice onward to reflect the 17% fee you set on the Subscription

digital pollenBOT
carmine shore
#

The beta sounds like exactly what we need. Should I enroll with the master account for our stripe?

arctic maple
#

Yes, I recommend enrolling the platform account

carmine shore
#

Can I ask one more thing please?

#

API related

#

I am trying to follow this example:

#

to instead charge an account when a payment is completed but I get:

#

Cannot create account debit on this account; please contact us via https://support.stripe.com/contact with details for assistance.

#

why can't I charge an account directly?

wheat vector
carmine shore
#

req_bgefyr9yUKawTK

wheat vector
#

you're attempting to debit a Standard account which is not supported