#luka_multi-capture-checkout
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/1347259239701413888
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
an advance payment authorisation without debit
Is it possible to combine it with a classic session?
What do you mean by "classic session"?
What Stripe product/tech are you referring to?
yes I know I've already read it ^^
I'm setting up a car rental site, and I need the user to pay and at the same time authorise the bank imprint.
So what do you mean when you say "payment session"? There is no Stripe API or object called a Payment Session so I need to know what Stripe product you are referring to.
const session = await stripe.checkout.sessions.create({
payment_method_types: ['card'],
line_items: [
{
price_data: {
currency: 'eur',
product_data: {
name: vehicle[0].vehicule_name,
description: Réservation du ${startDate} au ${endDate},
},
unit_amount: totalPrice,
},
quantity: 1,
},
],
mode: 'payment', // Paiement immédiat pour la réservation
success_url: ${process.env.CLIENT_URL}/success?session_id={CHECKOUT_SESSION_ID}&id=${booking_id},
cancel_url: ${process.env.CLIENT_URL}/pay?id=${booking_id},
customer: customerID[0].id,
metadata: {
userId,
idVehicule,
startDate,
endDate,
hour,
bookingId
},
});
logger.info("Stripe checkout session created", { sessionId: session.id });
// Créer un SetupIntent pour enregistrer la carte
const setupIntent = await stripe.setupIntents.create({
payment_method_types: ['card'],
customer: `${customerID[0].id}`, // Associe le SetupIntent à l'utilisateur (Stripe Customer)
metadata: {
userId,
idVehicule,
startDate,
endDate,
bookingId
}
});
yeah like this
Ah, Stripe Checkout Session
yes sorry a checkout session*
And you want to collect some funds up front and authorize a hold for more funds?
I'd like to create the bank imprint at the same time, but I need the id of the customer's payment method, which I don't have at the moment as he hasn't paid.
yes at the same time
But you can only do one or the other.
ah and you can set an amount to authorise direct debit at that time if the rental does not go well
So if you specify payment_intent_data={"capture_method": "manual"}, that means you will not collect any funds immediately from the Checkout Session. You will create the imprint to authorize collection of the funds at a later date
OK, and I can both receive payment from the customer, for example $500 for the cost of hiring the vehicle, and ask for a payment authorisation that I can renew for $1,500 if the hire goes wrong.
At the same time ?
No, that is exactly the opposite of what I described
ah
I'm just looking for a way to do this with a single authorisation, is that possible?
You mean one authorization for the full amount and you capture some of the funds up front and wait to capture the rest?
yes that is what i mean
That would be a multi-capture situation and we describe how to do that, and the limitations, in this doc
OK, so with a multi-capture system you can both make the customer pay straight away and save the rest of the payment authorisation for later if you need to. As a result, payment authorisations last for 7 days or more, depending on the business sector. However, the user will not be debited for this amount. For example, it authorises $8,000 but for the payment $2,000 is taken and the rest is in payment authorisation, so it won't be debited?
and will it work on time-limited virtual credit cards? Suppose the credit card expires, is there any security for that?
Corrrect. With multi-capture, you can authorize an amount, collect part of it right away (in a second API request) and collect the rest at a later date (before the auth expires)
and will it work on time-limited virtual credit cards? Suppose the credit card expires, is there any security for that?
These are the requirements you will need to review
ok perfect thank you very much
When you make the API request some cards will return a result that shows multi-capture is not supported. Your customers will need to use a differet card in that case
OK and I guess I'll deal with that in the webhook that handles stripe responses.
perfect
Thank you so much for your time!
Have a great day!
Great 🎉 Happy to help 🙂