#kekko7072_api

1 messages ยท Page 1 of 1 (latest)

acoustic fernBOT
#

๐Ÿ‘‹ 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.

fair maple
#

I'd like to know how to access to the fee taken by stripe directly from the api payment like checkout or payment_intent

violet pierBOT
crisp nacelle
fair maple
#

can i pass it directly when the payment it's made?

crisp nacelle
#

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.

fair maple
#

can i add the expand[]"="latest_charge.balance_transaction" to the paymentIntents.create() or paymentIntents.capture()?

crisp nacelle
#

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.

fair maple
#

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"],
});

crisp nacelle
#

Yup, offhand that looks right.