#stripe_connect_platform-checkout-connect
1 messages ยท Page 1 of 1 (latest)
Are you asking how to set an application fee when creating a Checkout Session? Or are you asking how to get it after already setting it?
How to set it? Sorry I am debugging code and am confused about some things.
Are you working with subscriptions or one-off payments?
Always everything, but right now subscriptions.
I have to clean up both to make sure we are getting the application fee and also listening correctly for events created by us while ignoring events created by others
You can set subscription_data.application_fee_percent (see https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-application_fee_percent) for checkout sesions + subcriptions
"A non-negative decimal between 0 and 100"
Uh huh? Do you want an integer or a decimal?
How do you want the decimal?
like 0.01?
do you mean a non-negative decimal between 0.00 and 1.00 ????
Invalid decimal: {:"0"=>"1"}
Invalid decimal: {:"0"=>"0.01"}
I tried:
application_fee_percent = 0.01
I tried 1 and 0.01 both seem to fail
Oh, maybe you want 1.00
a float?
I see it working when I pass in an integer like 11
Do you have a request I can take a look at?
OK, I got it.
Now onto 1-time payments.
How do we collect the application fee on 1-time payments?
It's right here in payment_intent_data.application_fee_amount : https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-application_fee_amount
oh yes, got it!
pi_3LcGMBGkntF0z1iA1qp211y3
OK looks good 1% or $1 on $100 or 100 cents for 10000 cents payment.
๐
When we get webhooks on these payments, what is the best way to determine that we were the application that created them (and ignore webhooks about payments from other apps). Is it by using metadata? We used to use that but I think every object should have a .application with our ca_xxxx - is that correct?
I think using metadata was a really bad way since we did not know that the application was listed on each webhook. Or do we need to use metadata for some reason (i.e. will the application of record show up in the params without us having to make API calls to look up data on an object?
We used to use that but I think every object should have a .application with our ca_xxxx - is that correct?
only a small subset of API Resources haveapplicationbutChargeandPaymentIntenthave it which should be enough for you
metadata is a good way overall but another app could use the same metadata key as you