#luka_multi-capture-checkout

1 messages · Page 1 of 1 (latest)

glad prairieBOT
#

👋 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.

ancient pine
#

Hi 👋

What do you mean by "bank imprint"?

#

Do you mean placing a hold on funds?

slow cipher
#

an advance payment authorisation without debit

ancient pine
#

Yes, we allow that

#

We have an integration guide specifically for that flow here

slow cipher
#

Is it possible to combine it with a classic session?

ancient pine
#

What do you mean by "classic session"?

#

What Stripe product/tech are you referring to?

slow cipher
#

I'm setting up a car rental site, and I need the user to pay and at the same time authorise the bank imprint.

ancient pine
#

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.

slow cipher
#

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

ancient pine
#

Ah, Stripe Checkout Session

slow cipher
#

yes sorry a checkout session*

ancient pine
#

And you want to collect some funds up front and authorize a hold for more funds?

slow cipher
#

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.

ancient pine
#

You can place a hold and capture funds later using Checkout. We describe that here

ancient pine
#

But you can only do one or the other.

slow cipher
#

ah and you can set an amount to authorise direct debit at that time if the rental does not go well

ancient pine
#

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

slow cipher
#

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 ?

ancient pine
#

No, that is exactly the opposite of what I described

slow cipher
#

ah

#

I'm just looking for a way to do this with a single authorisation, is that possible?

ancient pine
#

You mean one authorization for the full amount and you capture some of the funds up front and wait to capture the rest?

slow cipher
#

yes that is what i mean

ancient pine
#

That would be a multi-capture situation and we describe how to do that, and the limitations, in this doc

slow cipher
#

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?

ancient pine
#

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

ancient pine
#

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

slow cipher
#

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!

ancient pine
#

Great 🎉 Happy to help 🙂