Files
commerce/payment/processor/answer.go
zooqueenandHanzo Dev c91ebb4a47 billing: a wallet sale asks Square again instead of guessing, and seats are bounded
An authorization with no answer is sent again under its key; a capture with
no answer is settled by reading the payment back, taking one still held. Only
a payment Square says it did not take lets the attempt go; one that stays
unknown seals the attempt (502), so its key never pays twice, and is named
for reconciliation. Everything after the authorization runs without the
buyer's request. Square's own 4xx is a processor.Answer; anything else may be
a call that never got one. A first invoice that is not written is tried twice
and reconciled. Nothing charged and the sale cannot go on now is 503.

Seats are at most a per-seat plan's maxMembers, else 10000, on subscribe,
create and PATCH, so price times seats never wraps.

A subscription's plan snapshot carries its catalog slug, so a reader can
match it to GET /v1/billing/plans.

Co-authored-by: Hanzo Dev <[email protected]>
2026-10-15 22:26:31 -07:00

11 lines
448 B
Go

package processor
// Answer is a processor's own refusal of a call: the call reached it and it said
// no, so nothing it was asked to do was done. An error that is not an Answer
// may be a call that never got one, after which the processor may have acted.
type Answer struct{ Err error }
func (a *Answer) Error() string { return a.Err.Error() }
func (a *Answer) Unwrap() error { return a.Err }
func (a *Answer) Answered() bool { return true }