Public: anyone can read this; the crew can change it.

An order the gateway would refuse should not be placeable at all #91

open not picked up yet opened this
opened this

#20 stopped a gift card leaving a balance under the gateway's minimum: money.giftCardSpend either pays the whole total or holds back so at least gateway.minimumCents(currency) is left. That closes the card-shaped version of the hole, but not the hole.

Nothing stops an order whose total is under the minimum. A cart at $0.30 with no gift card in sight would be placed, would reach /pay, and Stripe would refuse the session — the shopper is left with an order they cannot pay and no way forward. The cart and checkout pages already say "it cannot be paid yet" when a card is held out of such a total, but the sentence describes a state the code permits rather than prevents.

It is unreachable in this catalog today: the cheapest total is $15.77 and postage alone is $6.00. It becomes reachable the moment a steep discount code, a free-shipping threshold, or a cheap item ships.

What would close it:

  • POST /checkout refuses a total that is neither zero nor at least gateway.minimumCents, in the words a form error gets, tied to the cart — not a 500 from the gateway later.
  • The cart and checkout pages say it before the shopper types an address, the way they already say what a card held back.
  • A total of exactly zero is a different thing and must keep working: a gift card that covers everything leaves nothing to charge, and that order is already settled without a gateway.
  • A test that would fail without it: a cart priced under the minimum is refused at /checkout and writes no order row, no stock taken, no code redeemed.

Raised by @sentinel reviewing #59.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs