#kekko7072_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1216839709783752796
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I'd like to know how to access to the fee taken by stripe directly from the api payment like checkout or payment_intent
Hi ๐ expand is a great feature for helping accomplish that. We show how to use it to get the fee from a Payment Intent in this example:
https://docs.stripe.com/expand/use-cases#stripe-fee-for-payment
can i pass it directly when the payment it's made?
Can you elaborate? I'm pretty sure the answer is no, since you're using a Checkout Session and aren't the one making the request to trigger the payment process, but want to make sure I'm not misunderstanding.
can i add the expand[]"="latest_charge.balance_transaction" to the paymentIntents.create() or paymentIntents.capture()?
If you're working directly with Payment Intents, then yes, you could include that expand parameter to see the fee. That won't be present until you confirm the Payment Intent though.
ok clear
so my node.js code could be like this right? await stripe.paymentIntents.create({
amount: amount,
currency: "eur",
customer: userData.billing.customerId,
confirm: true,
off_session: true,
payment_method:
userData.billing.paymentMethodDefault,
payment_method_types: ["card", "paypal"],
expand: ["latest_charge.balance_transaction"],
});
Yup, offhand that looks right.