Multiple payments with a single autorisation (/3D secure) using stripe

45 views Asked by At

The use case is the following: a user gets billed by the minute, therefore the total amount amount is not known in advance.

This is similar to what you experience at the gaz station.

Our current solution is the same as the gaz station, we hold a fixed amount (MAX_AMOUNT) that is greater to the maximum total amount possible bill. At the end, we capture only what has been consumed (the rest should be released MAX_AMOUNT - amount).

The problem of the current solution is the value of MAX_AMOUNT (its a bit expensive for some customers).

We though maybe we could make several smaller holds, but that would imply several 3D secure. Is there any solution that would not involve a large initial hold?

Side note

We are using the python API (import stripe.api_resources as api) and:

  • register the user's card using api.checkout.Session.create;
  • then, hold MAX_AMOUT using api.PaymentIntent.create;
  • and finally capture amount using api.PaymentIntent.capture.
1

There are 1 answers

1
Nolan H On

Breaking this up into multiple payments does not really make it less expensive, as the customer still has the total held on their cards, the same as one large hold. You would be increasing your paid Stripe fees with multiple payments, too.

Really what you're doing is already optimal with a pre-auth amount then capture for the real amount. You need to optimize the amount you hold initially based on your knowledge of the customer and predicted payment.

For customers that end up exceeding that amount, you can do an additional auth when needed to cover that.

Note that you can skip your middle step by using checkout payment mode with manual capture: payment_intent_data[capture_method]=manual (API ref)

And for the later payments you should ensure you set setup_future_usage: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage