Payment & Checkout Guardrails
Checkout and payment components stop accidental extra zeros, duplicate submit double-charges, expired cards, and surprise totals before transactions reach your payment gateway. Each component installs with shadcn and pairs with server-side idempotency.
The extra zero, the double charge, the expired card and the surprise total.
Requires the thumb to travel the whole track before confirming, so accidental taps and pocket presses don't send payments.
Reads back exactly when access ends, what is lost and what is refunded before someone cancels, and ends on a receipt with an undo.
Makes lowering a seat count an explicit choice of who loses access, with the new bill and what happens to their work.
Collapses repeated clicks, Enter spam and double-taps into one request and reuses an idempotency key on retry, so your server can dedupe.
Asks for a second click before buying the same item again and shows each purchase against daily or monthly caps before it goes through.
Checks a flight or train passenger name against the ID and reads it back as it will print, so a name mismatch doesn't cost a fee or a boarding.
Measures a dropped map pin against the typed address and PIN area, so a delivery doesn't go to the wrong door.
Reads the state from an Indian PIN's first digits as you type and flags a mismatch with the chosen state, so a parcel doesn't go to the wrong place.
Cleans and checks a coupon code and says exactly why it didn't apply, so shoppers don't give up on a code that should work.
Compares a pasted IBAN, UPI ID or wallet address with what was copied or expected, so a clipboard hijacker's swapped address is caught before paying.
A money field that groups digits as you type, spells the amount out and flags an amount about ten times off the usual one.
Checks IBAN, card and ISBN check digits as you type and points to the swapped or doubled character, so money and orders don't go to a mistyped number.
Checks a shipping address for a missing house number, a postcode that doesn't fit the country or city, and PO boxes, so parcels aren't returned.
Catches mistyped GSTIN, PAN and EU VAT numbers by checking their structure and the GSTIN check character, and pointing at the wrong character.
Turns an empty search into fixes that are proven to return results: a spelling fix, a layout fix, a dropped filter or all categories.
Masks a card expiry as MM/YY and reads it back as a date, catching month 13, a year typed first or a card that expires before the next renewal.
Catches IFSC typos like the letter O for the fixed zero, then reads the branch back so a transfer doesn't go to the wrong bank or branch.
Catches mistyped UPI IDs, cleans pasted upi://pay links and reads back the registered name, so money isn't sent to the wrong VPA.
Helps an international payment arrive in full: it measures what the recipient actually gets against the invoice, after fees and bank deductions.
Reads back a loan's EMI, total interest, fees and real yearly cost before signing, so a borrower doesn't agree to a costlier loan than they think.
Asks each child's age and checks the room split, so a hotel booking isn't bounced for an over-age child, a lone infant or an over-full room.
Converts UK, US, EU and IN sizes live and catches a usual size clicked in the wrong system, like US 8 picked as UK 8.
Holds suspicious quantity jumps for a "Did you mean 10?" check and clamps to stock with a reason, so an accidental bulk order isn't placed.
Catches 0.15 typed for 15%, basis-point slips and rates over the cap, and reads the result back in money, so a rate isn't 100 times off.
Keeps splits adding up to exactly the total, showing what's left as you type and rounding automatic splits so nothing is off by one.
Reads a recurring price back in every billing period and catches a yearly price typed into the monthly field.
Labels each side of a size, fills all three from a pasted "16 x 12 x 8 in" and catches wrong units or an extra digit, so the wrong package size doesn't ship.
Makes "includes / excludes GST" an explicit choice and reads back net + tax = gross, so tax isn't added twice.
Validates a passport MRZ (ICAO 9303 TD3) check digit by check digit and catches OCR slips before details reach a booking or KYC form.
Checks a passport against the destination's validity rule and names the date it must last until, so a trip isn't booked that the passport can't make.
Catches group seat picks that split the party, leave a single empty seat or seat a child away from every adult.
Lists every answer of a multi-step form by step with Edit links before submit, flagging empty, missing and changed answers.
When a parent field changes, clears only the dependent values it made invalid and names each one with Undo, so fields don't vanish silently.
Highlights fields that the browser or password manager autofilled and flags values that look wrong, like an email in the Name field.
Reduces lost, doubled and blank entries in add-another forms with undoable removes, duplicate flags and min/max limits.
Reads a date range back as nights and days so bookings and leave requests aren't off by one.
Counts down to a store's order cutoff in store time with the shopper's time beside it, so an order doesn't land on a different day than expected.
Lines up hotel nights under the flights and catches a stay booked for the wrong night, like a room from the date of a 00:50 landing.
Lays out buy-now-pay-later payments on a calendar with paydays and other plans, so an instalment doesn't fail on an expired card or before payday.
Flags layovers that may need a transit visa for the traveller's passport, and the itinerary traps that force them through the border.
Warns before closing the tab mid-payment, upload or migration and says clearly when it is safe to close, so work isn't cut off halfway.
Keeps a blocked control focusable and explains exactly what blocks it, with a jump to each fix, so disabled buttons aren't dead ends.
Checks a bill split against the printed receipt so nobody is quietly overcharged by double-counted tax, a tip on a service charge or a missed item.
Shows a held FX, swap or fare quote counting down and makes any worse re-quote an explicit Accept step, so nobody pays a price they never saw.
Reads back what a credit card payment amount really costs before Pay, so paying the minimum or a little short doesn't quietly trigger interest.
Says in one sentence what a one-time code really approves and warns hard during a call or screen share, so it's less likely to be read out to a scammer.
Says when an Indian bank transfer will actually arrive on IMPS, NEFT, RTGS or UPI, and catches amounts the chosen rail will refuse.
Interrupts a gift card checkout that looks like a scam payment and asks one question before the order goes through.
Reads a UPI AutoPay mandate back against the plan before the PIN, flagging a cap far above the price, no end date or the wrong merchant.
Shows a UPI collect request as the payment it really is and asks whether the user expects money, since a UPI PIN only ever sends money.
Works out what an Indian freelancer's invoice actually lands as after GST and TDS, and flags TDS taken on GST or at the wrong rate.
Tells a double tap, a retry after a timeout and a deliberate repeat payment apart, so the same payee isn't paid twice by accident.
Reads back what a subscribe button really commits to: today's charge, first real charge, price step-ups and the cancel-by time.
Checks an Indian GST invoice for the wrong tax head (CGST + SGST vs IGST), a rate not in force on the invoice date, and amounts that don't add up.
Shows what will be charged today, when the first and renewal charges happen and what taxes apply, so checkout has no surprise charges.
Shows an approximate, dated conversion of a foreign price and prices a merchant's currency conversion, so budgets abroad use the right number.
Asks the bank who holds an account and compares that with the name typed, like Confirmation of Payee, so money doesn't go to the wrong account.
Shows tips in money on a stated base and holds back accidental huge tips, like 250 typed in the % field.
Shows the exact refund before it's issued: units per item, every deduction named, non-refundable items explained, and net amount per refund method.
Before an upgrade or downgrade, reads back today's charge, credits, the next bill and any usage over the new plan's limits, so nobody is surprised by a charge or lost data.
Checks a bank transfer reference against each rail's length and character limits, so the invoice number reaches the payee intact.
Shows where a scanned QR code really goes before anything opens, so a fake sticker over a real code doesn't send you somewhere else.
Re-adds rows in exact arithmetic and points at the likely slip when a total doesn't match, or says it's only rounding.
Marks the cells that actually differ in a comparison table and shows blanks as "Not stated", so people don't pick the wrong plan.
Spells an amount in words and names each digit group, so ₹2,50,000 isn't written or read as ₹25,00,000.
Shows how many reviews stand behind a star rating and how they split, so a 5.0 from three reviews doesn't look as solid as a 4.6 from 900.
Puts every pack on a common unit price and marks the real cheapest, catching bulk packs and multi-buys that cost more per unit.
Turns a raw error code into what happened, the likely cause and one next step, and warns when a timed-out payment may already have gone through.
Quotes delivery as a realistic date range, naming a likely day only when one stands out, so customers aren't promised an impossible day.
Use Safe Submit (`safe-submit`) to lock the submit button the instant it is clicked and generate an idempotency key header. Install with `npx shadcn@4.21.0 add @bollard/safe-submit`. Limitation: the payment gateway and backend must process the idempotency key to prevent network replays.
Amount Input (`amount-input`) compares the entered number to a typical baseline and warns if the user entered 10x or 100x the expected magnitude. Install with `npx shadcn@4.21.0 add @bollard/amount-input`. Limitation: does not enforce bank balance or credit limits.
Card Expiry Input (`card-expiry-input`) auto-formats MM/YY and flags expired dates immediately. Install with `npx shadcn@4.21.0 add @bollard/card-expiry-input`. Limitation: does not verify bank card status or account validity.
Review Step (`review-step`) displays a final confirmation summary table before checkout. Install with `npx shadcn@4.21.0 add @bollard/review-step`. Limitation: prices and inventory must still be verified on the server.