Files
zooqueenandHanzo Dev a265087b13 No route makes or records a refund; a refund or dispute is recorded only from the processor's signed webhook, once, and an inquiry that closes without a chargeback restores its period
Commerce never initiates a refund. POST /v1/billing/refunds, POST /v1/billing/refund,
POST /v1/order/:orderid/refund and POST /v1/payment/:paymentid/refund are gone with
their handlers (engine.CreateRefund, checkout Refund, square.Refund) and the helpers
only they used; GET /v1/billing/refunds stays read-only. A claim is settled by a
replacement order, never a refund.

A refund or dispute of a plan's payment reaches its invoice only from the
processor's webhook, under the processor's own refund id, through one locked
writer that reads the invoice afresh (engine.RecordRefund, engine.RecordDispute).
Every state a dispute reports reaches the invoice; INQUIRY_CLOSED holds the
payment no longer, WON stays final and LOST stays disputed.

No backfill of the payment-to-invoice index is run: the only plan payments made
before v1.50.139 are the team's own card purchases (z24, zk) and one Square
record.

Co-authored-by: Hanzo Dev <[email protected]>
2026-10-01 17:04:54 -07:00

29 lines
1.7 KiB
Go

package checkout
import "errors"
var (
FailedToCreateCustomer = errors.New("Failed to create customer")
FailedToCreateUser = errors.New("Failed to create user")
FailedToDecodeRequestBody = errors.New("Failed to decode request body")
FailedToReserveItem = errors.New("Item already reserved")
FeeCalculationError = errors.New("Failed to calculate fees")
FundingAccountCreationError = errors.New("Failed to create funding account")
InvalidOrIncompleteOrder = errors.New("Invalid or incomplete order")
OnlyOneOfUserBuyerAllowed = errors.New("Only one of user buyer allowed")
OrderDoesNotExist = errors.New("Order does not exist")
PaymentCancelled = errors.New("Payment was cancelled")
TokenSaleNotFound = errors.New("Token sale not found")
TransactionLimitReached = errors.New("Transaction Amount May Not Exceed Limit of 5000000")
UnsupportedBitcoinCurrency = errors.New("BTC/XBT is supported for 'bitcoin' payment method")
UnsupportedEthereumCurrency = errors.New("Only ETH is supported for 'ethereum' payment method")
UnsupportedPaymentType = errors.New("Unsupported payment type")
UnsupportedFiatCurrency = errors.New("XBT(BTC), ETH not supported by fiat payment method")
UserDoesNotExist = errors.New("User does not exist")
UserNotProvided = errors.New("None of user, user.id, order.userId is set")
WalletCreationError = errors.New("Failed to create wallet for user")
MissingTokenSaleOrPassphrase = errors.New("order.tokenSaleId or tokenSale.passphrase is missing")
OrderTotalIsLessThan1 = errors.New("order.total is less than 1")
AuthorizationFailed = errors.New("Failed to authorize")
)