Review request

Barber shop no-show fee, did Cursor set up the saved card correctly?

Solved · 2 views · asked by sam_builds · edited

Repo or live app

github.com/samokafor/chair-noshow

Unsure about: SecurityOther

Booking is free, but if you do not show up we charge 15 euro. Cursor built it with a SetupIntent at booking time and a PaymentIntent the next morning for the no-shows. First real attempt failed with something about authentication and I did not follow the error. Three no-shows so far, none of them charged.

Comment

1 answer

Marked as helpful by the asker
priya_ships · edited

The setup is right, the follow-through is missing. Two details.

When you create the SetupIntent, set usage: 'off_session'. If it was created as on_session, the card is saved but the bank was never told to expect a later charge, and European cards then decline it.

When you charge, you must handle the authentication_required error. That is not a bug, it is the customer's bank asking for 3D Secure, and nobody is there to do it:

try {
  await stripe.paymentIntents.create({ amount: 1500, currency: 'eur', customer, payment_method, off_session: true, confirm: true })
} catch (e) {
  if (e.code === 'authentication_required') {
    // mail the customer a link to e.paymentIntent.client_secret to confirm
  }
}

Without that branch the charge fails silently, which is what your three no-shows look like.

Comment