#joseamica
1 messages · Page 1 of 1 (latest)
Hi 👋 are you referring to Stripe's fees? If so, I'd recommend reaching out to our Support team:
https://support.stripe.com/?contact=true
If you're talking about charging fees as part of your integration, can you elaborate?
Find help and support for Stripe. Our support site 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.
Hi toby, I am developing a payment solution for restaurants in which the clients can pay the bill or split the bill. Of course im using stripe, but i dont know if the code is not good.
This is my createPaymentIntent function on my backend:
const createPaymentIntent = async (req, res) => {
const { amounts, customerId, currency, paymentMethodId, params } = req.body
console.log(amounts)
const rest_fee = amounts.total * 0.02
try {
const paymentIntent = await stripe.paymentIntents.create({
customer: customerId,
amount: amounts.total - rest_fee,
currency: currency,
payment_method: paymentMethodId,
setup_future_usage: 'off_session',
application_fee_amount: amounts.avoFee + rest_fee,
transfer_data: {
destination: 'acct_1Oks58PmsglnVXF2',
},
metadata: {
venueId: params.venueId,
billId: params.billId,
tipPercentage: amounts.tipPercentage,
avoFee: amounts.avoFee,
total: amounts.total,
amount: amounts.amount,
},
})
res.json({ id: paymentIntent.id, client_secret: paymentIntent.client_secret })
} catch (err) {
console.log(err)
res.status(500).json('Error creating payment intent')
}
}
I just want to know what is going on here, because the numbers doesnt match
Can you provide more details? What numbers are you looking at that don't match, where did those come from?
Well i provide them
I need to charge to the restaurant a 2% fee for every transaction, additionaly to 0.5% to the user.
if (amount.amount / 100 < 10) {
return <div>El monto mÃnimo es de $10</div>
}
const tip = amount.amount * tipPercentage
const avoFee = amount.amount * 0.05
const total = Math.round(amount.amount + tip + avoFee)
Okay, and what are you seeing currently? How is that different from what you're expecting? I need more details about specific numbers you're seeing, and expecting to see, in order to help provide any guidance on why those don't align. Right now I have the code you're using to create a Payment Intent, but I don't grasp why that isn't doing what you're hoping.