#B33fb0n3-connect
1 messages ยท Page 1 of 1 (latest)
hi! you need the public and private keys of your platform, and then you use the Stripe-Account header on requests set to the ID of the connected account https://stripe.com/docs/connect/authentication ; that's all you ever need
as for how to take fees on Orders using Connect, not sure, let me look, this is a new API to me
yeah sure ๐
I believe it would be this : https://stripe.com/docs/api/orders_v2/create#create_order_v2-payment-settings-application_fee_amount you pass the application_fee_amount you want to take there
the fee works the same as this : https://stripe.com/docs/connect/direct-charges#flow-of-funds-with-fees
and then you use the Stripe-Account header on requests set to the ID of the connected account
const stripe = require('stripe')(stripeKey, {
apiVersion: '2020-08-27; orders_beta=v3',
stripeAccount: "acct_1connectedAccountID"
});
Can I do it just like this, cause I am using the sdk?
well acct_1connectedAccountID is naturally a placeholder for the real ID of the account, but yes, that's how it works, per my link : https://stripe.com/docs/connect/authentication#adding-the-connected-account-id-to-a-client-side-application
Yeah, but the payment intent is created with the order. So I cant controll it...
ah nice ๐
And than the order will be created at the connected account and not at the plattform account, right?
try the parameter I mentioned
if you create it on the backend that way then yes
which again means using your platform secret key and passing Stripe-Account , in the backend call to create the Order
so I cant init the sdk with the accountid. I need to pass the connected account id in every operation, right?
like this:
oh and than the connected account id will also be redirected to the payment intent, right?
yeah, sure.
depends. On the frontend in stripe.js you have to initialise stripe.js with stripeAccount globally. On the backend in most of our libraries it's set on a per-request basis, so they're different
not sure what that means, it's the end-customer who is paying, not the connected account. Using the Stripe-Account header means the Order/PaymentIntent/other objects are created on the connected account and the money lands directly in their account(minus any fee you specify)
ah ok ๐
ah. The order is created with the header. But I cant controll how the payment intent will be created. So I cannot offer this (see screenshot). But if I send the order with the connected account id, than this will be automatically do stripe and offers the value, right?
the PaymentIntent is created by the order
so it will be on the same account as the Order, you don't need to do anything special really
ah ok, great!
Can I somehow get the total amount of the order in one request, cause I want the fee by percent of the order total amount. I dont want to get the total amount from the frontend cause it could be manipulated. Currently I do this: https://paste.gg/p/anonymous/048af9ade5be447e9ad3e041f8e1bba9
not sure unfortunately, Orders are really new to me
my colleague will be taking over this thread in a moment while I get lunch and might know
I saw the order have this value
sure, no problem. Have a great lunch ๐
@restive kiln u will take over this thread?
Yes I will. Just getting caught up on this one now, sorry for the dealy
no problem ๐
So are you saying that that amount_total does work for you or are you looking for the pre-tax amount to calculate your percentage on?
I'd like to charge my customers with percentage amount of the total amount from the order. amount_total does work, but I have 2 requests. Can I do this smarter?
Gotcha, thanks for the clarification. I am less familiar with the orders API but am looking in to how to do this in one call
sure, take ur time ๐
Unfortunately I am not finding any good leads here though like I said I am not as familiar with it. If you write in to our support team, they should be able to direct you to the team that runs this beta and they will have a better idea on if this is possible https://support.stripe.com/?contact=true
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
ok ๐
After I process the Order the customer get's redirected to the given return_url sometime the url get's the query with paymentintentid and paymentintent secret and sometimes with orderid and ordersecret. When does what happen?
I am also not immediately sure on that, I can check in to the Payment Intents if you send me their IDs but I may have to direct you to the team that is running the beta again
ok we can do this ๐
Last question. Can I somehow check if the payment elements are loaded? The user enters the page and the iframe loads. It obviesly not directly there, so I want to disable some buttons. How can I check if the <PaymentElement/> are rendered?
Would the on ready event help you here or is that something slightly different? https://stripe.com/docs/js/element/events/on_ready
@restive kiln I cant use this element, cause I develope in react
hii @vast river are u the person who is going to take over this thread? Cause Pompey went just offline
Hi there ๐ apologies for the delay while I work to get caught up. I'm not the most well-versed in React, so would you mind helping me understand why you can't listen for that event with it?
no problem. I want to give u a personal example. Which programm languages do u now (web)?
whether backend or frontend does not matter
Ah, a teammate also just pointed me to the props that we have built into our React library that seem like they'd be used to achieve what you're looking for:
https://stripe.com/docs/stripe-js/react#element-components
yeah, thats the library I use. How do I solve my problem?
Hey there ๐
Stepping in here
You can use onReady prop to listen for an event that would fire when the PaymentElement is fully rendered
hii there.
Just use this in my useEffect function?
For example
const runThisFunction = (e) => { console.log(`PaymentElement rendered`) }
<PaymentElement onReady={runThisFunction} />
Thank u ๐
Hello! Stripe is telling me to update bank info so they are holding my payments. The bank information is/has been the same for years
Where is that?